public abstract class AbstractName extends Object implements GenericName, Serializable
"org.opengis.util.Record"
, or they may be relative to a scope
like "util.Record"
in the "org.opengis"
scope.
See the GeoAPI javadoc for an illustration.
Subclasses need only to implement the following methods:
Comparable
orderingequals(Object)
.
The natural ordering is case-insensitive and ignores the character separator between
name elements.Defined in the sis-utility module
Modifier | Constructor and Description |
---|---|
protected |
AbstractName()
Creates a new instance of generic name.
|
Modifier and Type | Method and Description |
---|---|
static AbstractName |
castOrCopy(GenericName object)
Returns a SIS name implementation with the values of the given arbitrary implementation.
|
int |
compareTo(GenericName name)
Compares this name with the specified name for order.
|
int |
depth()
Indicates the number of levels specified by this name.
|
boolean |
equals(Object object)
Compares this generic name with the specified object for equality.
|
abstract List<? extends LocalName> |
getParsedNames()
Returns the sequence of local names making this generic name.
|
int |
hashCode()
Returns a hash code value for this generic name.
|
LocalName |
head()
Returns the first element in the sequence of parsed names.
|
ScopedName |
push(GenericName scope)
Returns this name expanded with the specified scope.
|
abstract NameSpace |
scope()
Returns the scope (name space) in which this name is local.
|
LocalName |
tip()
Returns the last element in the sequence of parsed names.
|
GenericName |
toFullyQualifiedName()
Returns a view of this name as a fully-qualified name.
|
InternationalString |
toInternationalString()
Returns a local-dependent string representation of this generic name.
|
String |
toString()
Returns a string representation of this generic name.
|
public static AbstractName castOrCopy(GenericName object)
null
, then this method returns null
.AbstractName
,
then it is returned unchanged.LocalName
, then this
method delegates to DefaultLocalName.castOrCopy(LocalName)
.AbstractName
subclass is created using the
DefaultNameFactory.createGenericName(NameSpace, CharSequence[])
method.object
- The object to get as a SIS implementation, or null
if none.null
if the argument was null.public abstract NameSpace scope()
"org.opengis.util.Record"
and if this instance is the "util.Record"
part, then its scope is
named "org.opengis"
.
Continuing with the above example, the full "org.opengis.util.Record"
name has
no scope. If this method is invoked on such name, then the SIS implementation returns a
global scope instance (i.e. an instance for which DefaultNameSpace.isGlobal()
returns true
) which is unique and named "global"
.
scope
in interface GenericName
public int depth()
getParsedNames()
method.depth
in interface GenericName
public abstract List<? extends LocalName> getParsedNames()
getParsedNames
in interface GenericName
null
neither empty.public LocalName head()
LocalName
, this is always this
.
Example: Ifthis
name is"org.opengis.util.Record"
(no matter its scope, then this method returns"org"
.
head
in interface GenericName
public LocalName tip()
LocalName
, this is always this
.
Example: Ifthis
name is"org.opengis.util.Record"
(no matter its scope, then this method returns"Record"
.
tip
in interface GenericName
public GenericName toFullyQualifiedName()
this
.toFullyQualifiedName
in interface GenericName
null
).public ScopedName push(GenericName scope)
scope
with this
. For example if
this
name is "util.Record"
and the given scope
argument is
"org.opengis"
, then this.push(scope)
shall return
"org.opengis.util.Record"
.push
in interface GenericName
scope
- The name to use as prefix.public String toString()
getParsedNames()
separated by a namespace-dependent character (usually ':'
or '/'
).
This rule implies that the result may or may not be fully qualified.
Special cases:
toFullyQualifiedName().toString()
is guaranteed to
contain the scope (if any).tip().toString()
is guaranteed to not contain
any scope.toString
in interface GenericName
toString
in class Object
public InternationalString toInternationalString()
toString()
except that each element
has been localized in the specified locale.
If no international string is available, then this method returns an implementation mapping
to toString()
for all locales.toInternationalString
in interface GenericName
public int compareTo(GenericName name)
LocalName
. If a name lexicographically
precedes or follows the corresponding element of the specified name, returns
a negative or a positive integer respectively.compareTo
in interface Comparable<GenericName>
name
- The other name to compare with this name.public boolean equals(Object object)
true
if the scopes
and the lists of parsed names are equal.Copyright © 2010–2013 The Apache Software Foundation. All rights reserved.