Class NamedIdentifier

    • Constructor Detail

      • NamedIdentifier

        public NamedIdentifier​(Citation authority,
                               InternationalString code)
        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 constructor with a properties map.
        Parameters:
        authority - The authority (e.g. OGC or EPSG).
        code - The code. The English name is used for the code, and the international string is used for the generic name.
      • NamedIdentifier

        public NamedIdentifier​(Citation authority,
                               String code)
        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 constructor with a properties map.
        Parameters:
        authority - The authority (e.g. OGC or EPSG).
        code - The code. This parameter is mandatory.
      • NamedIdentifier

        public NamedIdentifier​(Citation authority,
                               String code,
                               String version)
        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 constructor with a properties map.
        Parameters:
        authority - The authority (e.g. OGC or EPSG).
        code - The code. This parameter is mandatory.
        version - The version, or null if none.
    • Method Detail

      • getCode

        public String getCode()
        Identifier code or name, optionally from a controlled list or pattern.
        Specified by:
        getCode in interface Identifier
        Returns:
        The code.
      • getCodeSpace

        public String getCodeSpace()
        Name or identifier of the person or organization responsible for namespace.
        Specified by:
        getCodeSpace in interface ReferenceIdentifier
        Returns:
        The codespace, or null if not available.
      • getAuthority

        public Citation getAuthority()
        Organization or party responsible for definition and maintenance of the code.
        Specified by:
        getAuthority in interface Identifier
        Returns:
        The authority, or null if not available.
      • getVersion

        public String getVersion()
        Identifier of the version of the associated code space or code, as specified by the code authority. This version is included only when the code uses versions. When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
        Specified by:
        getVersion in interface ReferenceIdentifier
        Returns:
        The version, or null if not available.
      • getRemarks

        public InternationalString getRemarks()
        Comments on or information about this identifier, or null if none.
        Returns:
        Optional comments about this identifier.
      • scope

        public NameSpace scope()
        Returns the scope (name space) in which this name is local.
        Specified by:
        scope in interface GenericName
        Returns:
        The scope of this name.
        Since:
        2.3
      • depth

        public int depth()
        Returns the depth of this name within the namespace hierarchy.
        Specified by:
        depth in interface GenericName
        Returns:
        The depth of this name.
        Since:
        2.3
      • getParsedNames

        public List<LocalName> getParsedNames()
        Returns the sequence of 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.
        Specified by:
        getParsedNames in interface GenericName
        Returns:
        The local names making this generic name, without the scope. Shall never be null neither empty.
      • push

        public ScopedName push​(GenericName scope)
        Returns this name expanded with the specified scope. One may represent this operation as a concatenation of the specified name with this.
        Specified by:
        push in interface GenericName
        Parameters:
        scope - The name to use as prefix.
        Returns:
        A concatenation of the given name with this name.
        Since:
        2.3
      • toFullyQualifiedName

        public GenericName toFullyQualifiedName()
        Returns a view of this name as a fully-qualified name.
        Specified by:
        toFullyQualifiedName in interface GenericName
        Returns:
        The fully-qualified name (never null).
        Since:
        2.3
      • toInternationalString

        public InternationalString toInternationalString()
        Returns a local-dependent string representation of this generic name. This string is similar to the one returned by toString() except that each element has been localized in the specified locale. If no international string is available, then this method returns an implementation mapping to toString() for all locales.
        Specified by:
        toInternationalString in interface GenericName
        Returns:
        A localizable string representation of this name.
      • toString

        public String toString()
        Returns a string representation of this generic name. This string representation is local-independant. It contains all elements listed by getParsedNames() separated by an arbitrary character (usually : or /).
        Specified by:
        toString in interface GenericName
        Overrides:
        toString in class Object
        Returns:
        A local-independant string representation of this name.
      • compareTo

        public int compareTo​(GenericName object)
        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.
        Specified by:
        compareTo in interface Comparable<GenericName>
        Parameters:
        object - The object to compare with.
        Returns:
        -1 if this identifier precedes the given object, +1 if it follows it.
      • equals

        public boolean equals​(Object object)
        Compares this identifier with the specified object for equality.
        Overrides:
        equals in class Object
        Parameters:
        object - The object to compare with this name.
        Returns:
        true if the given object is equals to this name.
      • hashCode

        public int hashCode()
        Returns a hash code value for this identifier.
        Overrides:
        hashCode in class Object