Class Scopes
java.lang.Object
org.microbean.scopelet.Scopes
A utility class for working with scopes and their identifiers.
- Author:
- Laird Nelson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindScope(Collection<? extends Attributes> c) Returns the firstAttributesthat is present in the suppliedCollectionofAttributes, and their meta-attributes, for which an invocation of thescope(Attributes)method returnstrue, ornull, if no suchAttributesexists.none()Returns a non-null, determinateAttributesrepresenting the identifier for the none scope.normal()booleannormal(Attributes a) Returnstrueif the suppliedAttributeshas elements that might be used to indicate that it is a normal scope.pseudo()scope()Returns the non-null, determinateAttributesthat can be used to designate otherAttributesas a scope.booleanscope(Attributes a) Returnstrueif and only if the suppliedAttributesis a scope identifier.Returns a non-null, determinateAttributesrepresenting the identifier for the singleton pseudo-scope.
-
Constructor Details
-
Scopes
Creates a newScopes.- Parameters:
qualifiers- aQualifiers; must not benull- Throws:
NullPointerException- ifqualifiersisnull
-
-
Method Details
-
findScope
Returns the firstAttributesthat is present in the suppliedCollectionofAttributes, and their meta-attributes, for which an invocation of thescope(Attributes)method returnstrue, ornull, if no suchAttributesexists.The search is conducted in a breadth-first manner.
- Parameters:
c- aCollectionofAttributes; must not benull- Returns:
- the first
Attributesthat is present in the suppliedCollectionofAttributes, and their meta-attributes, for which an invocation of thescope(Attributes)method returnstrue, ornull, if no suchAttributesexists - Throws:
NullPointerException- ifcisnull
-
none
Returns a non-null, determinateAttributesrepresenting the identifier for the none scope.- Returns:
- a non-
null, determinateAttributesrepresenting the identifier for the none scope
-
normal
-
normal
Returnstrueif the suppliedAttributeshas elements that might be used to indicate that it is a normal scope.- Parameters:
a- anAttributes; must not benull- Returns:
trueif the suppliedAttributeshas elements that might be used to indicate that it is a normal scope- Throws:
NullPointerException- ifaisnull- See Also:
-
pseudo
-
scope
Returns the non-null, determinateAttributesthat can be used to designate otherAttributesas a scope.- Returns:
- the non-
null, determinateAttributesthat can be used to designate otherAttributesas a scope
-
scope
Returnstrueif and only if the suppliedAttributesis a scope identifier.- Parameters:
a- anAttributes; must not benull- Returns:
trueif and only if the suppliedAttributesis a scope identifier- Throws:
NullPointerException- ifaisnull
-
singleton
Returns a non-null, determinateAttributesrepresenting the identifier for the singleton pseudo-scope.- Returns:
- a non-
null, determinateAttributesrepresenting the identifier for the singleton pseudo-scope
-