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 1DefaultNameFactory.parseGenericName(NameSpace, CharSequence)
without separatorNameSpace
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.Defined 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, toFullyQualifiedName
push, toFullyQualifiedName
protected 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
.DefaultLocalName
,
then it is returned unchanged.DefaultLocalName
instance is created using the
DefaultNameFactory.createLocalName(NameSpace, CharSequence)
method,
or the createTypeName
or createMemberName
variants if the
given object implements the corresponding interface.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 GenericName
scope
in class AbstractName
public final int depth()
depth
in interface GenericName
depth
in interface LocalName
depth
in class AbstractName
public final List<DefaultLocalName> getParsedNames()
this
.getParsedNames
in interface GenericName
getParsedNames
in interface LocalName
getParsedNames
in class AbstractName
null
neither empty.public final LocalName head()
this
since this object is already a local name.head
in interface GenericName
head
in interface LocalName
head
in class AbstractName
this
.public final LocalName tip()
this
since this object is already a local name.tip
in interface GenericName
tip
in interface LocalName
tip
in class AbstractName
this
.public String toString()
toString
in interface GenericName
toString
in interface LocalName
toString
in class AbstractName
public InternationalString toInternationalString()
toInternationalString
in interface GenericName
toInternationalString
in class AbstractName
public int compareTo(GenericName name)
compareTo
in interface Comparable<GenericName>
compareTo
in class AbstractName
name
- The other name to compare with this name.public boolean equals(Object object)
equals
in class AbstractName
object
- The object to compare with this name for equality.true
if the given object is equal to this name.Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.