Class DefaultScopedName
Object
AbstractName
DefaultScopedName
- All Implemented Interfaces:
Serializable, Comparable<GenericName>, GenericName, ScopedName
A composite of a name space (as a local name) and a generic name valid in that name space.
See the GeoAPI javadoc for more information.
DefaultScopedName can be instantiated by any of the following methods:
DefaultNameFactory.createGenericName(NameSpace, CharSequence[])with an array of length 2 or more.DefaultNameFactory.parseGenericName(NameSpace, CharSequence)with at least one occurrence of the separator in the path.- Similar static convenience methods in
Names.
Immutability and thread safety
This class is immutable and thus inherently thread-safe if theNameSpace and all CharSequence
elements in the arguments given to the constructor are also immutable. Subclasses shall make sure that any
overridden methods remain safe to call from multiple threads and do not change any public LocalName
state.- Since:
- 0.3
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultScopedName(GenericName path, String separator, CharSequence tail) Constructs a scoped name as the concatenation of the given generic name with a single character sequence.protectedDefaultScopedName(GenericName path, GenericName tail) Constructs a scoped name as the concatenation of the given generic names.protectedDefaultScopedName(NameSpace scope, List<? extends CharSequence> names) Constructs a scoped name from the specified list of strings. -
Method Summary
Modifier and TypeMethodDescriptionList<? extends LocalName> Returns the sequence of local name for this generic name.path()Returns every element in the sequence of parsed names except for the tip.tail()Returns every elements in the sequence of parsed names except for the head.Methods inherited from class AbstractName
castOrCopy, compareTo, depth, equals, hashCode, head, push, tip, toFullyQualifiedName, toInternationalString, toStringModifier and TypeMethodDescriptionstatic AbstractNamecastOrCopy(GenericName object) Returns a SIS name implementation with the values of the given arbitrary implementation.intcompareTo(GenericName name) Compares this name with the specified name for order.intdepth()Indicates the number of levels specified by this name.booleanCompares this generic name with the specified object for equality.intReturns a hash code value for this generic name.head()Returns the first element in the sequence of parsed names.push(GenericName scope) Returns this name expanded with the specified scope.tip()Returns the last element in the sequence of parsed names.Returns a view of this name as a fully-qualified name.Returns a local-dependent string representation of this generic name.Returns a string representation of this generic name.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ScopedName
head, tip, toStringModifier and TypeMethodDescriptionhead()Returns the first element in the sequence of parsed names.tip()Returns the last element in the sequence of parsed names.Returns a locale-independent string representation of this scoped name.
-
Constructor Details
-
DefaultScopedName
Constructs a scoped name from the specified list of strings. If any of the given names is an instance ofInternationalString, then itstoString(Locale.ROOT)method will be invoked for fetching an unlocalized name. Otherwise theCharSequence.toString()method will be used.- Parameters:
scope- the scope of this name, ornullfor the global scope.names- the local names. This list must have at least two elements.
-
DefaultScopedName
Constructs a scoped name as the concatenation of the given generic names. The scope of the new name will be the scope of thepathargument.- Parameters:
path- the first part to concatenate.tail- the second part to concatenate.
-
DefaultScopedName
Constructs a scoped name as the concatenation of the given generic name with a single character sequence. The scope of the new name will be the scope of thepathargument. The tail is a local name created from the given character sequence.- Parameters:
path- the first part to concatenate.separator- the separator between the head and the tail, ornullfor inheriting the same separator as the given path.tail- the second part to concatenate.- Since:
- 0.8
- See Also:
-
-
Method Details
-
tail
Returns every elements in the sequence of parsed names except for the head.- Specified by:
tailin interfaceScopedName- Returns:
- all elements except the first one in the in the list of parsed names.
-
path
Returns every element in the sequence of parsed names except for the tip.- Specified by:
pathin interfaceScopedName- Returns:
- all elements except the last one in the in the list of parsed names.
-
getParsedNames
Returns the sequence of local name for this generic name.- Specified by:
getParsedNamesin interfaceGenericName- Specified by:
getParsedNamesin classAbstractName- Returns:
- the local names making this generic name, without the scope.
Shall never be
nullneither empty.
-