public class ScopedName extends GenericName implements ScopedName
ScopedName
contains a LocalName
as
head and a GenericName, which may be a LocalName
or an other ScopedName
.NameFactory
,
Serialized FormDEFAULT_SEPARATOR
Constructor and Description |
---|
ScopedName(GenericName scope,
char separator,
CharSequence name)
Constructs a scoped name from the specified international string.
|
ScopedName(GenericName scope,
CharSequence name)
Constructs a scoped name from the specified international string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Compares this scoped name with the specified object for equality.
|
protected GenericName |
getInternalScope()
Returns the scope (name space) of this generic name.
|
List<LocalName> |
getParsedNames()
Returns the sequence of local name for this generic name.
|
char |
getSeparator()
Returns the separator character.
|
int |
hashCode()
Returns a hash code value for this generic name.
|
LocalName |
head()
Returns the head of this scoped name.
|
GenericName |
path()
Returns a name which contains every element of the parsed names
list except for the last element.
|
ScopedName |
push(GenericName scope)
Returns this name expanded with the specified scope.
|
GenericName |
tail()
Returns the tail of this scoped name.
|
LocalName |
tip()
Returns a view of this object as a local name.
|
GenericName |
toFullyQualifiedName()
Returns a view of this name as a fully-qualified name.
|
compareTo, depth, scope, toInternationalString, toString
toString
depth, scope, toInternationalString
compareTo
public ScopedName(GenericName scope, CharSequence name)
InternationalString
, then the
toString(null)
method will be used
in order to fetch an unlocalized name. Otherwise, the
toString()
method will be used.scope
- The scope (or "tail") of the variable.name
- The head (never null
).public ScopedName(GenericName scope, char separator, CharSequence name)
InternationalString
, then the
toString(null)
method will be used
in order to fetch an unlocalized name. Otherwise, the
toString()
method will be used.scope
- The scope (or "tail") of the variable.separator
- The separator character (usually ':'
or '/'
).name
- The head (never null
).public LocalName head()
head().scope() == this.scope()
head
in interface GenericName
head
in interface ScopedName
head
in class GenericName
public GenericName tail()
tail().getParsedNames() == this.getParsedNames().sublist(1,end)
Note: This condition can be understood in terms of the Java equals
method instead of the Java identity comparator ==
.
tail
in interface ScopedName
public GenericName path()
path
in interface ScopedName
File.getPath()
public char getSeparator()
public LocalName tip()
LocalName.toString()
will differs.tip
in interface GenericName
tip
in interface ScopedName
tip
in class GenericName
protected GenericName getInternalScope()
GenericName
null
. Can be a no-op if the subclass overrides GenericName.scope()
getInternalScope
in class GenericName
public List<LocalName> getParsedNames()
getParsedNames
in interface GenericName
getParsedNames
in class GenericName
public GenericName toFullyQualifiedName()
null
.toFullyQualifiedName
in interface GenericName
null
).public ScopedName push(GenericName scope)
name
with this
. In pseudo-code, the following
relationships must hold:
push(name).getParsedList() ==
name.getParsedList().addAll(getParsedNames())
push(name).scope() == name.GenericName.scope()
push(head()).tail() == this
Note: Those conditions can be understood in terms of the Java equals
method instead of the Java identity comparator ==
.
push
in interface GenericName
scope
- The name to use as prefix.public boolean equals(Object object)
equals
in class GenericName
object
- The object to compare with this name.true
if the given object is equals to this one.public int hashCode()
hashCode
in class GenericName
Copyright © 1996–2022 Geotools. All rights reserved.