public class Scope extends Object
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_SEPARATOR
The separator character used between different components of a scope, aka
"/".
|
Constructor and Description |
---|
Scope(String stringRep)
Parses a scope from a string representation.
|
Modifier and Type | Method and Description |
---|---|
Scope |
concat(Scope childScope)
Creates a new scope that is a sub-scope of this one with the subordinated
scope described by the given argument.
|
boolean |
equals(Object obj) |
List<String> |
getComponents()
Returns all components of the scope as an ordered list.
|
int |
hashCode() |
boolean |
isSubScopeOf(Scope other)
Tests whether this scope is a sub-scope of the given other scope, which
means that the other scope is a prefix of this scope.
|
boolean |
isSuperScopeOf(Scope other)
Inverse operation of
isSubScopeOf(Scope) . |
List<Scope> |
superScopes(boolean includeSelf)
Generates all super scopes of this scope including the root scope "/".
|
String |
toString() |
public static final String COMPONENT_SEPARATOR
public Scope(String stringRep)
stringRep
- string representation of the scopeIllegalArgumentException
- if the given string does not have the right syntaxpublic List<String> getComponents()
public Scope concat(Scope childScope)
childScope
- child to concatenate to the current scope for forming a
sub-scopepublic boolean isSubScopeOf(Scope other)
other
- other scope to testtrue
if this is a sub-scope of the other scope,
equality gives false
, toopublic boolean isSuperScopeOf(Scope other)
isSubScopeOf(Scope)
.other
- other scope to testtrue
if this scope is a strict super scope of the
other scope. equality also gives false
.public List<Scope> superScopes(boolean includeSelf)
includeSelf
- if set to true
, this scope is also included as
last element of the returned listCopyright © 2018 CoR-Lab. All rights reserved.