| java.lang.Object org.geotools.util.GenericName
All known Subclasses: org.geotools.util.LocalName, org.geotools.util.ScopedName,
GenericName | abstract public class GenericName implements org.opengis.util.GenericName,Serializable(Code) | | Base class for
and
structure for type and attribute
name in the context of name spaces.
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.
since: 2.1 version: $Id: GenericName.java 23632 2006-12-29 22:13:51Z desruisseaux $ author: Martin Desruisseaux See Also: NameFactory |
Field Summary | |
final public static char | DEFAULT_SEPARATOR The default separator character. |
Constructor Summary | |
protected | GenericName() Creates a new instance of generic name. |
Method Summary | |
public int | compareTo(Object object) Compares this name with the specified object for order. | abstract public int | depth() Returns the depth of this name within the namespace hierarchy. | public boolean | equals(Object object) Compares this generic name with the specified object for equality. | abstract public List | getParsedNames() Returns the sequence of
making this generic name. | char | getSeparator() Returns the separator character. | public int | hashCode() Returns a hash code value for this generic name. | abstract public LocalName | name() Returns the last element in the sequence of
. | abstract public NameSpace | scope() Returns the scope (name space) in which this name is local. | public InternationalString | toInternationalString() Returns a local-dependent string representation of this generic name. | public String | toString() Returns a string representation of this generic name. | static CharSequence | validate(CharSequence name) Ensures that the given name is a
String or an
InternationalString . |
DEFAULT_SEPARATOR | final public static char DEFAULT_SEPARATOR(Code) | | The default separator character.
|
GenericName | protected GenericName()(Code) | | Creates a new instance of generic name.
|
compareTo | public int compareTo(Object object)(Code) | | Compares this name with the specified object for order. Returns a negative integer,
zero, or a positive integer as this name lexicographically precedes, is equals to,
or follows the specified object. The comparaison is performed in the following
order:
- Compares each element in the
. If an
element of this name lexicographically precedes or follows the corresponding element
of the specified name, returns a negative or a positive integer respectively.
- If all elements in both names are lexicographically equal, then if this name has less
or more elements than the specified name, returns a negative or a positive integer
respectively.
- Otherwise, returns 0.
|
depth | abstract public int depth()(Code) | | Returns the depth of this name within the namespace hierarchy. This indicates the number
of levels specified by this name. For any
LocalName , it is always one. For a
ScopedName it is some number greater than or equal to 2.
The depth is the length of the list returned by the
GenericName.getParsedNames method.
As such it is a derived parameter.
since: 2.3 |
equals | public boolean equals(Object object)(Code) | | Compares this generic name with the specified object for equality.
|
getParsedNames | abstract public List getParsedNames()(Code) | | Returns the sequence of
making this generic name.
Each element in this list is like a directory name in a file path name.
The length of this sequence is the generic name depth.
|
hashCode | public int hashCode()(Code) | | Returns a hash code value for this generic name.
|
scope | abstract public NameSpace scope()(Code) | | Returns the scope (name space) in which this name is local. The scope is set on creation
and is not modifiable. The scope of a name determines where a name "starts". For instance,
if a name has a
of two (
"util.GenericName" ) and is
associated with a
having the name
"org.opengis" ,
then the fully qualified name would be
"org.opengis.util.GenericName" .
since: 2.3 |
toInternationalString | public InternationalString toInternationalString()(Code) | | Returns a local-dependent string representation of this generic name. This string
is similar to the one returned by
GenericName.toString except that each element has
been localized in the
. If no international string is available, then this method should
returns an implementation mapping to
GenericName.toString for all locales.
|
toString | public String toString()(Code) | | Returns a string representation of this generic name. This string representation
is local-independant. It contains all elements listed by
GenericName.getParsedNames separated by an arbitrary character (usually
: or
/ ).
This rule implies that the
toString() method for a
will contains the scope, while the
toString() method for the
of
the same name will not contains the scope.
|
|
|