|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractName
public abstract class AbstractName
A sequence of identifiers rooted within the context of a namespace.
Names are immutable. They may be fully qualified
like "org.opengis.util.Record", or they may be relative to a scope
like "util.Record" in the "org.opengis" scope. See GenericName javadoc
for an illustration.
Subclasses need only to implement the following methods:
Note: This class has a natural ordering that is inconsistent with equals. The natural ordering may be case-insensitive and ignore the character separator between name elements.
| metadata/geotk-metadata (download) | View source code for this class |
| Constructor Summary | |
|---|---|
protected |
AbstractName()
Creates a new instance of generic name. |
| Method Summary | |
|---|---|
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. |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractName()
| Method Detail |
|---|
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 Geotk implementation returns
a global scope instance (i.e. an instance for which NameSpace.isGlobal() returns
true) which is unique and named "global".
scope in interface GenericNamepublic int depth()
getParsedNames() method.
depth in interface GenericNamepublic abstract List<? extends LocalName> getParsedNames()
getParsedNames in interface GenericNamepublic LocalName head()
LocalName, this is always this.
Example:
If this name is "org.opengis.util.Record" (no matter its
scope), then this method returns "org".
head in interface GenericNamepublic LocalName tip()
LocalName, this is always this.
Example:
If this name is "org.opengis.util.Record" (no matter its
scope), then this method returns "Record".
tip in interface GenericNamepublic GenericName toFullyQualifiedName()
this.
toFullyQualifiedName in interface GenericNamepublic 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 returns
"org.opengis.util.Record".
push in interface GenericNamepublic 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
contains the scope (if any).tip().toString() is guaranteed to not contains
any scope.
toString in interface GenericNametoString in class Objectpublic 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 GenericNamepublic 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.
equals in class Objectobject - The object to compare with this name for equality.
true if the given object is equal to this name.public int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||