public class Scope
extends java.lang.Object
Constructor and Description |
---|
Scope(java.lang.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(java.lang.Object obj) |
java.util.List<java.lang.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) . |
java.util.List<Scope> |
superScopes(boolean includeSelf)
Generates all super scopes of this scope including the root scope "/".
|
java.lang.String |
toString() |
public Scope(java.lang.String stringRep)
stringRep
- string representation of the scopejava.lang.IllegalArgumentException
- if the given string does not have the right syntaxpublic java.util.List<java.lang.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 java.util.List<Scope> superScopes(boolean includeSelf)
includeSelf
- if set to true
, this scope is also included as
last element of the returned listpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object