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
, as tail.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 |
---|---|
ScopedName |
asScopedName()
Deprecated.
Replaced by
toFullyQualifiedName() . |
boolean |
equals(Object object)
Compares this scoped name with the specified object for equality.
|
List<LocalName> |
getParsedNames()
Returns the sequence of local name for this generic name.
|
GenericName |
getScope()
Deprecated.
Replaced by
GenericName.scope() . |
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.
|
asLocalName, compareTo, depth, name, scope, toInternationalString, toString
toString
depth, name, 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()
@Deprecated public GenericName getScope()
GenericName.scope()
.getScope
in class GenericName
public char getSeparator()
@Deprecated public ScopedName asScopedName()
toFullyQualifiedName()
.this
.asScopedName
in class GenericName
public LocalName tip()
LocalName.toString()
will differs.tip
in interface GenericName
tip
in interface ScopedName
tip
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–2019 Geotools. All rights reserved.