Interface ScopedName

  • All Superinterfaces:
    Comparable<GenericName>, GenericName
    All Known Implementing Classes:
    ScopedName

    public interface ScopedName
    extends GenericName
    A composite of a local name (as head) for locating another name space, and a generic name (as tail) valid in that name space. This definition allows for iteration. The tail may be either a local name or a scoped name. If it is a scoped name, then another another step towards a remote local name is taken. In this way, a scoped name may represent an arbitrarily distant local name simply by the number of times the tail() method evaluates to a ScopedName before finally terminating on a LocalName.

    It may be seen that ScopedName is the means by which fully-qualified names are expressed. However, a ScopedName is not, in itself, what is commonly thought of as a fully qualified name. The ScopedName type is one link in the chain, not the entire chain. A scoped name is a fully qualified name only if its scope is global.

    Example: The illustration below shows the head, tail, path and name of "org.geotools.api.util.Record".

    org .opengis .util .Record
    head tail
    path tip
    Since:
    GeoAPI 2.0
    Author:
    Martin Desruisseaux (IRD), Bryce Nordgren (USDA)
    See Also:
    NameFactory#createScopedName
    • Method Detail

      • head

        LocalName head()
        Returns the first element in the sequence of parsed names. The head element must exists in the same name space than this scoped name. In other words, the following relationship must holds:

        • head().scope() equals this.scope()

        This method is similar in purpose to Name.get(0) from the Java Naming and Directory Interface.

        Example: If this name is "org.geotools.api.util.Record", then this method shall returns "org".

        Specified by:
        head in interface GenericName
        Returns:
        The first element in the list of parsed names.
        Since:
        GeoAPI 2.2
      • path

        GenericName path()
        Returns every elements of the parsed names list except for the tip. In other words, the following relationship must holds:

        This method is similar in purpose to Name.getPrefix(size-1) from the Java Naming and Directory Interface.

        Returns:
        All elements except the last one in the in the list of parsed names.
        Since:
        GeoAPI 2.1
      • tip

        LocalName tip()
        Returns the last element in the sequence of parsed names.

        This method is similar in purpose to Name.get(size-1) from the Java Naming and Directory Interface.

        Specified by:
        tip in interface GenericName
        Returns:
        The last element in the list of parsed names.
        Since:
        GeoAPI 2.1
      • toString

        String toString()
        Returns a locale-independent string representation of this scoped name. This method encapsulates the domain logic which formats the parsed names into a legal string representation of the name. There will be variants on this theme. XML aficionados may require URIs. For Java classes, a dotted notation is more appropriate, for C/C++, a double-colon, for directories, a forward or reverse slash, and for CRS, it will depend on the mode of expression: URN or Authority:Identifier notation.
        Specified by:
        toString in interface GenericName
        Overrides:
        toString in class Object
        Returns:
        A local-independant string representation of this name.