public class DefaultLocalName extends AbstractName implements LocalName
DefaultLocalName can be instantiated by any of the following methods:
DefaultNameFactory.createLocalName(NameSpace, CharSequence).DefaultNameFactory.createGenericName(NameSpace, CharSequence[]) with an array of length 1.DefaultNameFactory.parseGenericName(NameSpace, CharSequence) with no occurrence of the separator in the path.Names.NameSpace and CharSequence
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.DefaultNameSpace,
DefaultScopedName,
Serialized FormDefined in the sis-utility module
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultLocalName(NameSpace scope,
CharSequence name)
Constructs a local name from the given character sequence.
|
| Modifier and Type | Method and Description |
|---|---|
static DefaultLocalName |
castOrCopy(LocalName object)
Returns a SIS local name implementation with the values of the given arbitrary implementation.
|
int |
compareTo(GenericName name)
Compares this name with the specified object for order.
|
int |
depth()
Returns the depth, which is always 1 for a local name.
|
boolean |
equals(Object object)
Compares this local name with the specified object for equality.
|
List<DefaultLocalName> |
getParsedNames()
Returns the sequence of local name for this name.
|
LocalName |
head()
Returns
this since this object is already a local name. |
NameSpace |
scope()
Returns the scope (name space) in which this name is local.
|
LocalName |
tip()
Returns
this since this object is already a local name. |
InternationalString |
toInternationalString()
Returns a local-dependent string representation of this local name.
|
String |
toString()
Returns a locale-independent string representation of this local name.
|
castOrCopy, hashCode, push, toFullyQualifiedNameclone, finalize, getClass, notify, notifyAll, wait, wait, waitpush, toFullyQualifiedNameprotected DefaultLocalName(NameSpace scope, CharSequence name)
InternationalString,
then its toString(Locale.ROOT)
method will be invoked for fetching an unlocalized name.
Otherwise the CharSequence.toString() method will be used.scope - the scope of this name, or null for a global scope.name - the local name (never null).public static DefaultLocalName castOrCopy(LocalName object)
null, then this method returns null.MemberName or TypeName,
then this method delegates to castOrCopy(…) method of the corresponding subclass.DefaultLocalName,
then it is returned unchanged.DefaultLocalName instance is created
with the same values than the given name.object - the object to get as a SIS implementation, or null if none.null if the argument was null.public NameSpace scope()
scope in interface GenericNamescope in class AbstractNamepublic final int depth()
depth in interface GenericNamedepth in interface LocalNamedepth in class AbstractNamepublic final List<DefaultLocalName> getParsedNames()
this.getParsedNames in interface GenericNamegetParsedNames in interface LocalNamegetParsedNames in class AbstractNamenull neither empty.public final LocalName head()
this since this object is already a local name.head in interface GenericNamehead in interface LocalNamehead in class AbstractNamethis.public final LocalName tip()
this since this object is already a local name.tip in interface GenericNametip in interface LocalNametip in class AbstractNamethis.public String toString()
toString in interface GenericNametoString in interface LocalNametoString in class AbstractNamepublic InternationalString toInternationalString()
toInternationalString in interface GenericNametoInternationalString in class AbstractNamepublic int compareTo(GenericName name)
compareTo in interface Comparable<GenericName>compareTo in class AbstractNamename - the other name to compare with this name.public boolean equals(Object object)
equals in class AbstractNameobject - the object to compare with this name for equality.true if the given object is equal to this name.Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.