net.ontopia.topicmaps.utils
Class ScopeUtils

java.lang.Object
  extended by net.ontopia.topicmaps.utils.ScopeUtils

public class ScopeUtils
extends java.lang.Object

INTERNAL: Scope processing utilities.


Constructor Summary
ScopeUtils()
           
 
Method Summary
static boolean isApplicableInContext(ScopedIF obj, java.util.Collection context)
          Checks to see if the ScopedIF's scope is applicable in the user context.
static boolean isIntersectionOfContext(ScopedIF obj, java.util.Collection context)
          Checks to see if the ScopedIF's scope intersects with the user context.
static boolean isIntersectionOfContext(ScopedIF obj, java.lang.Object[] context)
          EXPERIMENTAL:
static boolean isSubsetOfContext(ScopedIF obj, java.util.Collection context)
          Checks to see if the ScopedIF's scope is a subset of the user context.
static boolean isSupersetOfContext(ScopedIF obj, java.util.Collection context)
          Checks to see if the ScopedIF's scope is a superset of the user context.
static boolean isSupersetOfContext(ScopedIF obj, java.lang.Object[] context)
          EXPERIMENTAL:
static java.util.List rankByScope(java.util.Collection scoped, java.util.Collection scope)
          Ranks the ScopedIFs by the applicability to the specified scope.
static java.util.List rankByScope(java.util.Collection scoped, TopicIF theme)
          Ranks the ScopedIFs by the applicability to the specified scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopeUtils

public ScopeUtils()
Method Detail

isApplicableInContext

public static boolean isApplicableInContext(ScopedIF obj,
                                            java.util.Collection context)
Checks to see if the ScopedIF's scope is applicable in the user context. This is implies that the ScopedIF's scope must be either the unconstrained scope (empty) or a superset of the user context.

Parameters:
obj - The ScopedIF object to compare with.
context - The user context; a collection of TopicIFs.
Returns:
boolean; true if the scoped object's scope is applicable in the user context.

isSupersetOfContext

public static boolean isSupersetOfContext(ScopedIF obj,
                                          java.util.Collection context)
Checks to see if the ScopedIF's scope is a superset of the user context. The scope is a superset if it contains all the context themes.

Note that the unconstrained scope is in this case considered an empty set.

Parameters:
obj - The ScopedIF object to compare with.
context - The user context; a collection of TopicIFs.
Returns:
boolean; true if the scoped object's scope is a superset of the context.

isSupersetOfContext

public static boolean isSupersetOfContext(ScopedIF obj,
                                          java.lang.Object[] context)
EXPERIMENTAL:


isSubsetOfContext

public static boolean isSubsetOfContext(ScopedIF obj,
                                        java.util.Collection context)
Checks to see if the ScopedIF's scope is a subset of the user context. The scope is a subset if the context contains all the scope themes.

Note that the unconstrained scope is in this case considered an empty set.

Parameters:
obj - The ScopedIF object to compare with.
context - The user context; a collection of TopicIFs.
Returns:
boolean; true if the scoped object's scope is a subset of the context.

isIntersectionOfContext

public static boolean isIntersectionOfContext(ScopedIF obj,
                                              java.util.Collection context)
Checks to see if the ScopedIF's scope intersects with the user context. Note that there is no intersection when either collection is empty.

Note that the unconstrained scope is in this case considered an empty set.

Parameters:
obj - The ScopedIF object to compare with.
context - The user context; a collection of TopicIFs.
Returns:
boolean; true if the scoped object's scope intersects with the user context.

isIntersectionOfContext

public static boolean isIntersectionOfContext(ScopedIF obj,
                                              java.lang.Object[] context)
EXPERIMENTAL:


rankByScope

public static java.util.List rankByScope(java.util.Collection scoped,
                                         TopicIF theme)
Ranks the ScopedIFs by the applicability to the specified scope.


rankByScope

public static java.util.List rankByScope(java.util.Collection scoped,
                                         java.util.Collection scope)
Ranks the ScopedIFs by the applicability to the specified scope.



Copyright © 2000-2012 Ontopia.