- All Superinterfaces:
Comparable<GenericName>,GenericName
@UML(identifier="ScopedName",
specification=ISO_19103)
public interface ScopedName
extends GenericName
A composite of a
LocalName (as head) for locating another name space,
and a GenericName (as tail) valid in that name space.
For example, if this name is "org.opengis.util.Record",
then the head and tail components are as below.
The path and tip() are also shown for completeness:
This definition allows for iteration. The tail may be either a
LocalName or another ScopedName.
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.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionhead()Returns the first element in the sequence of parsed names.path()Returns every elements in the sequence parsed names except for the tip.tail()Returns every elements in the sequence of parsed names except for the head.tip()Returns the last element in the sequence of parsed names.toString()Returns a locale-independent string representation of this scoped name.Methods inherited from interface org.opengis.util.GenericName
compareTo, depth, getParsedNames, push, scope, toFullyQualifiedName, toInternationalString
-
Method Details
-
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:In the
GenericNamejavadoc, the heads are the blue elements in the head.tail column.Example: ifthisname is"org.opengis.util.Record", then this method shall returns"org".Analogy: this method is similar in purpose to:Path.getName(0)from Java I/O;Name.get(0)from the Java Naming and Directory Interface.
- Specified by:
headin interfaceGenericName- Returns:
- the first element in the list of parsed names.
-
tail
Returns every elements in the sequence of parsed names except for the head. In other words, the following relationship must holds:tail().getParsedNames()equalsthis.getParsedNames().sublist(1, depth)
In the
GenericNamejavadoc, the tails are the yellow elements in the head.tail column.Analogy: this method is similar in purpose tofrom the Java Naming and Directory Interface.Name.getSuffix(1)- Returns:
- all elements except the first one in the in the list of parsed names.
-
path
Returns every elements in the sequence parsed names except for the tip. In other words, the following relationship must holds:tip().getParsedNames()equalsthis.getParsedNames().sublist(0, depth-1)
In the
GenericNamejavadoc, the paths are the blue elements in the path.tip column.Analogy: this method is similar in purpose to:- the
File.getParentFile()orPath.getParent()from Java I/O; from the Java Naming and Directory Interface.Name.getPrefix(size-1)
- Returns:
- all elements except the last one in the in the list of parsed names.
Convenience extension to OGC/ISO standard
This method is not part of ISO specification. It has been added in GeoAPI as a complement of the ISOtail()method. -
tip
Returns the last element in the sequence of parsed names.In the
GenericNamejavadoc, the tips are the yellow elements in the path.tip column.Analogy: this method is similar in purpose to:- the
File.getName()orPath.getFileName()method in Java I/O; Name.get(size-1)from the Java Naming and Directory Interface.
- Specified by:
tipin interfaceGenericName- Returns:
- the last element in the list of parsed names.
- the
-
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 orAuthority:Identifiernotation.Analogy: this method is similar in purpose to theFile.toString()orPath.toString()method in Java I/O.- Specified by:
toStringin interfaceGenericName- Overrides:
toStringin classObject- Returns:
- the local-independent string representation of this name.
-