Package net.ontopia.topicmaps.utils
Class ScopeUtils
java.lang.Object
net.ontopia.topicmaps.utils.ScopeUtils
INTERNAL: Scope processing utilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisApplicableInContext(ScopedIF obj, Collection<TopicIF> context) Checks to see if the ScopedIF's scope is applicable in the user context.static booleanisIntersectionOfContext(ScopedIF obj, Collection<TopicIF> context) Checks to see if the ScopedIF's scope intersects with the user context.static booleanisIntersectionOfContext(ScopedIF obj, TopicIF[] context) EXPERIMENTAL:static booleanisSubsetOfContext(ScopedIF obj, Collection<TopicIF> context) Checks to see if the ScopedIF's scope is a subset of the user context.static booleanisSupersetOfContext(ScopedIF obj, Collection<TopicIF> context) Checks to see if the ScopedIF's scope is a superset of the user context.static booleanisSupersetOfContext(ScopedIF obj, TopicIF[] context) EXPERIMENTAL:rankByScope(Collection<S> scoped, Collection<TopicIF> scope) Ranks the ScopedIFs by the applicability to the specified scope.rankByScope(Collection<S> scoped, TopicIF theme) Ranks the ScopedIFs by the applicability to the specified scope.
-
Constructor Details
-
ScopeUtils
public ScopeUtils()
-
-
Method Details
-
isApplicableInContext
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
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
EXPERIMENTAL: -
isSubsetOfContext
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
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
EXPERIMENTAL: -
rankByScope
Ranks the ScopedIFs by the applicability to the specified scope. -
rankByScope
public static <S extends ScopedIF> List<S> rankByScope(Collection<S> scoped, Collection<TopicIF> scope) Ranks the ScopedIFs by the applicability to the specified scope.
-