Package org.geotools.util
Class LocalName
- Object
- 
- GenericName
- 
- LocalName
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<GenericName>,- GenericName,- LocalName
 
 public class LocalName extends GenericName implements LocalName Identifier within a name space for a local object. This could be the target object of theGenericName, or a pointer to another name space (with a newGenericName) one step closer to the target of the identifier.- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
- See Also:
- NameFactory, Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class GenericNameDEFAULT_SEPARATOR
 
- 
 - 
Constructor SummaryConstructors Constructor Description LocalName(CharSequence name)Constructs a local name from the specified string with no scope.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(GenericName object)Compares this name with the specified object for order.intdepth()Returns the depth, which is always 1 for a local name.booleanequals(Object object)Compares this local name with the specified object for equality.protected GenericNamegetInternalScope()Returns the scope (name space) of this generic name.List<LocalName>getParsedNames()Returns the sequence of local name for this generic name.inthashCode()Returns a hash code value for this local name.LocalNamehead()Since this object is already a local name, this method always returnsthis.ScopedNamepush(GenericName scope)Returns this name expanded with the specified scope.NameSpacescope()Returns the scope (name space) in which this name is local.LocalNametip()Since this object is already a local name, this method always returnsthis.GenericNametoFullyQualifiedName()Returns a view of this name as a fully-qualified name.InternationalStringtoInternationalString()Returns a local-dependent string representation of this locale name.StringtoString()Returns a locale-independant string representation of this local name.
 
- 
- 
- 
Constructor Detail- 
LocalNamepublic LocalName(CharSequence name) Constructs a local name from the specified string with no scope. If the specified name is anInternationalString, then thetoString(null)method will be used in order to fetch an unlocalized name. Otherwise, thetoString()method will be used.- Parameters:
- name- The local name (never- null).
 
 
- 
 - 
Method Detail- 
getInternalScopeprotected GenericName getInternalScope() Returns the scope (name space) of this generic name. This method is protected from overriding by the user.- Specified by:
- getInternalScopein class- GenericName
 
 - 
scopepublic NameSpace scope() 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 depth of two ("util.GenericName") and is associated with a name space having the name"org.opengis", then the fully qualified name would be"org.geotools.api.util.GenericName".- Specified by:
- scopein interface- GenericName
- Overrides:
- scopein class- GenericName
- Returns:
- The name space.
- Since:
- 2.3
 
 - 
depthpublic int depth() Returns the depth, which is always 1 for a local name.- Specified by:
- depthin interface- GenericName
- Specified by:
- depthin interface- LocalName
- Overrides:
- depthin class- GenericName
- Returns:
- The depth of this name.
- Since:
- 2.3
 
 - 
getParsedNamespublic List<LocalName> getParsedNames() Returns the sequence of local name for this generic name. Since this object is itself a locale name, this method always returns a singleton containing onlythis.- Specified by:
- getParsedNamesin interface- GenericName
- Specified by:
- getParsedNamesin interface- LocalName
- Specified by:
- getParsedNamesin class- GenericName
- Returns:
- The sequence of local names.
 
 - 
headpublic LocalName head() Since this object is already a local name, this method always returnsthis.- Specified by:
- headin interface- GenericName
- Specified by:
- headin interface- LocalName
- Overrides:
- headin class- GenericName
- Returns:
- The first element of this name.
 
 - 
tippublic LocalName tip() Since this object is already a local name, this method always returnsthis.- Specified by:
- tipin interface- GenericName
- Specified by:
- tipin interface- LocalName
- Overrides:
- tipin class- GenericName
- Returns:
- The last element of this name.
 
 - 
toFullyQualifiedNamepublic GenericName toFullyQualifiedName() Returns a view of this name as a fully-qualified name. The scope of a fully qualified name must be global. This method never returnsnull.- Specified by:
- toFullyQualifiedNamein interface- GenericName
- Returns:
- The fully-qualified name (never null).
- Since:
- 2.3
 
 - 
pushpublic ScopedName push(GenericName scope) Returns this name expanded with the specified scope. One may represent this operation as a concatenation of the specifiednamewiththis. In pseudo-code, the following relationships must hold:- push(name).getParsedList() == name.getParsedList().addAll(getParsedNames())
- push(name).scope() == name.scope()
 Note: Those conditions can be understood in terms of the Java equalsmethod instead of the Java identity comparator==.- Specified by:
- pushin interface- GenericName
- Parameters:
- scope- The name to use as prefix.
- Returns:
- A concatenation of the given name with this name.
- Since:
- 2.3
 
 - 
toStringpublic String toString() Returns a locale-independant string representation of this local name. This string do not includes the scope, which is consistent with the parsed names definition.- Specified by:
- toStringin interface- GenericName
- Specified by:
- toStringin interface- LocalName
- Overrides:
- toStringin class- GenericName
- Returns:
- A string representation of this name.
 
 - 
toInternationalStringpublic InternationalString toInternationalString() Returns a local-dependent string representation of this locale name.- Specified by:
- toInternationalStringin interface- GenericName
- Overrides:
- toInternationalStringin class- GenericName
- Returns:
- A localizable string representation of this name.
 
 - 
compareTopublic int compareTo(GenericName object) 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 case-insensitive.- Specified by:
- compareToin interface- Comparable<GenericName>
- Overrides:
- compareToin class- GenericName
- Parameters:
- object- The name to compare with this name.
- Returns:
- -1 if this name precedes the given one, +1 if it follows, 0 if equals.
 
 - 
equalspublic boolean equals(Object object) Compares this local name with the specified object for equality.- Overrides:
- equalsin class- GenericName
- Parameters:
- object- The object to compare with this name.
- Returns:
- trueif the given object is equals to this one.
 
 - 
hashCodepublic int hashCode() Returns a hash code value for this local name.- Overrides:
- hashCodein class- GenericName
 
 
- 
 
-