DefaultLocalName (Apache SIS 1.6 API) JavaScript is disabled on your browser.     Skip navigation links Overview Class Use Tree New Deprecated Index Search Help org.apache.sis.metadata org.apache.sis.util.iso DefaultLocalName Contents  Description Immutability and thread safety Constructor Summary Method Summary Constructor Details DefaultLocalName(NameSpace, CharSequence) Method Details castOrCopy(LocalName) scope() depth() getParsedNames() head() tip() toString() toInternationalString() compareTo(GenericName) equals(Object) Hide sidebar  Show sidebar Class DefaultLocalName Object AbstractName DefaultLocalName All Implemented Interfaces: Serializable, Comparable<Generic­Name>, Generic­Name, Local­Name Direct Known Subclasses: Default­Member­Name, Default­Type­Name public class DefaultLocalName extends AbstractName implements LocalName Identifier within a name space for a local object. Local names are names which are directly accessible to and maintained by a name space. Names are local to one and only one name space. The name space within which they are local is indicated by the scope. Default­Local­Name can be instantiated by any of the following methods: Default­Name­Factory​.create­Local­Name(Name­Space, Char­Sequence). Default­Name­Factory​.create­Generic­Name(Name­Space, Char­Sequence[]) with an array of length 1. Default­Name­Factory​.parse­Generic­Name(Name­Space, Char­Sequence) with no 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 the Name­Space and Char­Sequence 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 Local­Name state. Since: 0.3 See Also: Default­Name­Space Default­Scoped­Name Serialized Form Constructor Summary Constructors Modifier Constructor Description protected Default­Local­Name(Name­Space scope, Char­Sequence name) Constructs a local name from the given character sequence. Method Summary All MethodsStatic MethodsInstance MethodsConcrete Methods Modifier and Type Method Description static Default­Local­Name cast­Or­Copy(Local­Name object) Returns a SIS local name implementation with the values of the given arbitrary implementation. int compare­To(Generic­Name name) Compares this name with the specified object for order. final 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. final List<Default­Local­Name> get­Parsed­Names() Returns the sequence of local name for this name. final Local­Name head() Returns this since this object is already a local name. Name­Space scope() Returns the scope (name space) in which this name is local. final Local­Name tip() Returns this since this object is already a local name. International­String to­International­String() Returns a local-dependent string representation of this local name. String to­String() Returns a locale-independent string representation of this local name. Methods inherited from class AbstractName cast­Or­Copy, hash­Code, push, to­Fully­Qualified­Name Methods inherited from class Object clone, finalize, get­Class, notify, notify­All, wait, wait, wait Methods inherited from interface GenericName push, to­Fully­Qualified­Name Constructor Details DefaultLocalName protected DefaultLocalName(NameSpace scope, CharSequence name) Constructs a local name from the given character sequence. If the character sequence is an instance of International­String, then its to­String(Locale​.ROOT) method will be invoked for fetching an unlocalized name. Otherwise the Char­Sequence​.to­String() method will be used. Parameters: scope - the scope of this name, or null for a global scope. name - the local name. Shall not be null or empty. Method Details castOrCopy public static DefaultLocalName castOrCopy(LocalName object) Returns a SIS local name implementation with the values of the given arbitrary implementation. This method performs the first applicable action in the following choices: If the given object is null, then this method returns null. Otherwise if the given object is an instance of Member­Name or Type­Name, then this method delegates to cast­Or­Copy(…) method of the corresponding subclass. Otherwise if the given object is already an instance of Default­Local­Name, then it is returned unchanged. Otherwise a new Default­Local­Name instance is created with the same values as the given name. Parameters: object - the object to get as a SIS implementation, or null if none. Returns: a SIS implementation containing the values of the given object (may be the given object itself), or null if the argument was null. scope public NameSpace scope() Returns the scope (name space) in which this name is local. This method returns a non-null value in all cases, even when the scope given to the constructor was null. Specified by: scope in interface Generic­Name Specified by: scope in class Abstract­Name Returns: the scope of this name. depth public final int depth() Returns the depth, which is always 1 for a local name. Specified by: depth in interface Generic­Name Specified by: depth in interface Local­Name Overrides: depth in class Abstract­Name Returns: the depth of this name. getParsedNames public final List<DefaultLocalName> getParsedNames() Returns the sequence of local name for this name. Since this object is itself a local name, this method always returns a singleton containing only this. Specified by: get­Parsed­Names in interface Generic­Name Specified by: get­Parsed­Names in interface Local­Name Specified by: get­Parsed­Names in class Abstract­Name Returns: the local names making this generic name, without the scope. Shall never be null neither empty. head public final LocalName head() Returns this since this object is already a local name. Specified by: head in interface Generic­Name Specified by: head in interface Local­Name Overrides: head in class Abstract­Name Returns: this. tip public final LocalName tip() Returns this since this object is already a local name. Specified by: tip in interface Generic­Name Specified by: tip in interface Local­Name Overrides: tip in class Abstract­Name Returns: this. toString public String toString() Returns a locale-independent string representation of this local name. This string does not include the scope, which is consistent with the parsed names definition. Specified by: to­String in interface Generic­Name Specified by: to­String in interface Local­Name Overrides: to­String in class Abstract­Name Returns: a local-independent string representation of this name. toInternationalString public InternationalString toInternationalString() Returns a local-dependent string representation of this local name. Specified by: to­International­String in interface Generic­Name Overrides: to­International­String in class Abstract­Name Returns: a localizable string representation of this name. compareTo public int compareTo(GenericName name) Compares this name with the specified object for order. Returns a negative integer, zero, or a positive integer as this name lexicographically precedes, is equal to, or follows the specified object. Specified by: compare­To in interface Comparable<Generic­Name> Overrides: compare­To in class Abstract­Name Parameters: name - the other name to compare with this name. Returns: -1 if this name precedes the given one, +1 if it follows, 0 if equals. equals public boolean equals(Object object) Compares this local name with the specified object for equality. Overrides: equals in class Abstract­Name Parameters: object - the object to compare with this name for equality. Returns: true if the given object is equal to this name.