/** * Returns the generic name of this identifier. The name will be constructed automatically the * first time it will be needed. The name's scope is infered from the shortest alternative title * (if any). This heuristic rule seems raisonable since, according ISO 19115, the {@linkplain * Citation#getAlternateTitles alternate titles} often contains abreviation (for example "DCW" * as an alternative title for "Digital Chart of the World"). If no alternative title is found * or if the main title is yet shorter, then it is used. */ private synchronized GenericName getName() { if (name == null) { name = getName(authority, code); } return name; }
/** * Returns the last element in the sequence of {@linkplain #getParsedNames parsed names}. * * @since 2.3 */ public LocalName tip() { return getName().tip(); }
/** * Returns the first element in the sequence of {@linkplain #getParsedNames parsed names}. * * @since 2.6 */ public LocalName head() { return getName().head(); }
/** * Returns the sequence of {@linkplain LocalName local names} making this generic name. Each * element in this list is like a directory name in a file path name. The length of this * sequence is the generic name depth. */ public List<LocalName> getParsedNames() { // TODO: temporary hack to be removed after GeoAPI update. return (List) getName().getParsedNames(); }
/** * Returns the scope (name space) in which this name is local. * * @since 2.3 */ public NameSpace scope() { return getName().scope(); }
/** * Returns this name expanded with the specified scope. One may represent this operation as a * concatenation of the specified {@code name} with {@code this}. * * @since 2.3 */ public ScopedName push(final GenericName scope) { return getName().push(scope); }
/** * Returns a local-dependent string representation of this generic name. This string is similar * to the one returned by {@link #toString} except that each element has been localized in the * {@linkplain InternationalString#toString(Locale) specified locale}. If no international * string is available, then this method returns an implementation mapping to {@link #toString} * for all locales. */ public InternationalString toInternationalString() { return getName().toInternationalString(); }
/** * Returns a string representation of this generic name. This string representation is * local-independant. It contains all elements listed by {@link #getParsedNames} separated by an * arbitrary character (usually {@code :} or {@code /}). */ @Override public String toString() { return getName().toString(); }
/** * Returns the depth of this name within the namespace hierarchy. * * @since 2.3 */ public int depth() { return getName().depth(); }
/** * Returns a view of this name as a fully-qualified name. * * @since 2.3 */ public GenericName toFullyQualifiedName() { return getName().toFullyQualifiedName(); }
/** * 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. * * @param object The object to compare with. * @return -1 if this identifier precedes the given object, +1 if it follows it. */ public int compareTo(final GenericName object) { return getName().compareTo(object); }
/** * Constructs an identifier from an authority and code informations. This is a convenience * constructor for commonly-used parameters. If more control are wanted (for example adding * remarks), use the {@linkplain #NamedIdentifier(Map) constructor with a properties map}. * * @param authority The authority (e.g. {@link Citations#OGC OGC} or {@link Citations#EPSG * EPSG}). * @param code The code. The {@linkplain Locale#US English name} is used for the code, and the * international string is used for the {@linkplain GenericName generic name}. */ public NamedIdentifier(final Citation authority, final InternationalString code) { // The "null" locale argument is required for getting the unlocalized version. this(authority, code.toString(null)); name = getName(authority, code); }
/** * Returns the scope (name space) of this generic name. If this name has no scope (e.g. is the * root), then this method returns {@code null}. * * @deprecated Replaced by {@link #scope()}. */ public GenericName getScope() { return getName().scope().name(); }