Interface GenericName

    • Method Detail

      • scope

        @UML(identifier="scope",
             obligation=MANDATORY,
             specification=ISO_19103)
        NameSpace scope()
        Returns the scope (name space) in which this name is local. The scope of a name determines where a name starts. The scope is set on creation and is not modifiable.

        In the overview illustration, the scopes are the blue elements in the scope.this column.

        Example: For a fully qualified name (a name having a global namespace) "org.opengis.util.Record", if this instance is the "util.Record" name, then the scope of this instance has the "org.opengis" name.
        Analogy: This method is similar in purpose to:
        • the current directory of a file system.
        Returns:
        the scope of this name.
      • depth

        @UML(identifier="depth",
             obligation=MANDATORY,
             specification=ISO_19103)
        int depth()
        Indicates the number of levels specified by this name. The depth is the size of the list returned by the getParsedNames() method. As such it is a derived parameter. For any LocalName, it is always one. For a ScopedName it is some number greater than or equal to 2.
        Example: If this name is "urn:ogc:def:crs:EPSG:8.2:4326" with ':' as separator, then this method shall return 7. If this name is "EPSG:8.2:4326" in the "urn:ogc:def:crs" scope, then this method shall return 3.
        Analogy: This method is similar in purpose to:
        Returns:
        the depth of this name.
      • getParsedNames

        @UML(identifier="parsedName",
             obligation=MANDATORY,
             specification=ISO_19103)
        List<? extends LocalName> getParsedNames()
        Returns the sequence of local names making this generic name. The length of this sequence is the depth. It does not include the scope.

        In the overview illustration, the parsed names are the list of elements in yellow part of the scope.this column.

        Example: If this name is "urn:ogc:def:crs:EPSG::4326", then this method shall returns a list containing {"urn", "ogc", "def", "crs", "EPSG", "", "4326} elements in that iteration order. If this name is "EPSG::4326" in scope "urn:ogc:def:crs", then this method shall returns a list containing only {"EPSG", "", "4326"} elements.
        Analogy: This method is similar in purpose to:
        Returns:
        the local names making this generic name, without the scope. Shall never be null neither empty.
      • head

        @UML(identifier="ScopedName.head",
             obligation=MANDATORY,
             specification=ISO_19103)
        LocalName head()
        Returns the first element in the sequence of parsed names. For any LocalName, this is always this.

        In the overview illustration, the heads are the blue elements in the head.tail column.

        Example: If this name is "urn:ogc:def:crs:EPSG::4326", then this method shall returns "urn".
        Analogy: This method is similar in purpose to:
        Returns:
        the first element in the list of parsed names.
        Departure from OGC/ISO specification:
        ISO defines this method in ScopedName only. GeoAPI defines it in the base class since LocalName can return a sensible value for it. This reduces the need for casts.
      • tip

        LocalName tip()
        Returns the last element in the sequence of parsed names. For any LocalName, this is always this.

        In the overview illustration, the tips are the yellow elements in the head.tail column.

        Example: If this name is "urn:ogc:def:crs:EPSG::4326" (no matter its scope), then this method shall returns "4326".
        Analogy: This method is similar in purpose to:
        Returns:
        the last element in the list of parsed names.
        Departure from OGC/ISO specification:
        This method is not part of ISO specification. It does not provide any additional information compared to that accessible though the standard methods defined by ISO, but provides easier to access frequently requested information.
      • toFullyQualifiedName

        GenericName toFullyQualifiedName()
        Returns a view of this name as a fully-qualified name. The scope of a fully qualified name must be global. If the scope of this name is already global, then this method shall returns this.
        Example: If this name is "EPSG::4326" (depth of 3) and its scope is "urn:ogc:def:crs", then the fully qualified name is "urn:ogc:def:crs:EPSG::4326".
        Analogy: This method is similar in purpose to:
        Returns:
        the fully-qualified name (never null).
        Departure from OGC/ISO specification:
        This method is not part of ISO specification. It does not provide any additional information compared to that accessible though the standard methods defined by ISO, but makes easier to access frequently requested information.
      • push

        @UML(identifier="push",
             obligation=MANDATORY,
             specification=ISO_19103)
        ScopedName push​(GenericName scope)
        Returns this name expanded with the specified scope. One may represent this operation as a concatenation of the specified scope with this. In pseudo-code, the following relationships must hold (the last one is specific to ScopedName):
        Example: If this name is "EPSG::4326" and the given scope argument is "urn:ogc:def:crs", then this.push(scope) shall returns "urn:ogc:def:crs:EPSG::4326".
        Analogy: This method is similar in purpose to:
        • Name.addAll(0, name) from the Java Naming and Directory Interface.
        Parameters:
        scope - the name to use as prefix.
        Returns:
        a concatenation of the given scope with this name.
      • compareTo

        int compareTo​(GenericName other)
        Compares this name with an other name for order. The recommended ordering for generic names is to compare lexicographically each element in the list of parsed names. Specific attributes of the name, such as how it treats case, may affect the ordering.
        Analogy: This method is similar in purpose to:
        Specified by:
        compareTo in interface Comparable<GenericName>
        Parameters:
        other - the other object to be compared to this name.
        Returns:
        a negative integer, zero, or a positive integer as this name is lexicographically less than, equal to, or greater than the specified name.
      • toString

        String toString()
        Returns a string representation of this generic name. This string representation is local-independent. It contains all elements listed by getParsedNames() separated by a namespace-dependent character (usually '.', ':' or '/'). This rule implies that the result may or may not be fully qualified.

        Special cases:

        In the LocalName sub-type, this method maps to the aName ISO 19103 attribute. In the ScopedName sub-type, this method maps to the scopedName ISO 19103 attribute.

        Analogy: This method is similar in purpose to:
        Overrides:
        toString in class Object
        Returns:
        the local-independent string representation of this name.
      • toInternationalString

        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 shall returns an implementation mapping to toString() for all locales.
        Example: An implementation may want to localize the "My Documents" directory name into "Mes Documents" on French installation of Windows operating system.
        Returns:
        a localizable string representation of this name.
        Departure from OGC/ISO specification:
        This method is not part of the ISO specification. It has been added to provide a way to localize the name.