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 thetail()
method evaluates to aScopedName
before finally terminating on aLocalName
.It may be seen that
ScopedName
is the means by which fully-qualified names are expressed. However, aScopedName
is not, in itself, what is commonly thought of as a fully qualified name. TheScopedName
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocalName
head()
Returns the first element in the sequence of parsed names.GenericName
path()
Returns every elements of the parsed names list except for the tip.GenericName
tail()
Returns every elements of the parsed names list except for the head.LocalName
tip()
Returns the last element in the sequence of parsed names.String
toString()
Returns a locale-independent string representation of this scoped name.-
Methods inherited from interface Comparable
compareTo
-
Methods inherited from interface GenericName
depth, getParsedNames, push, scope, toFullyQualifiedName, toInternationalString
-
-
-
-
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 interfaceGenericName
- Returns:
- The first element in the list of parsed names.
- Since:
- GeoAPI 2.2
-
tail
GenericName tail()
Returns every elements of the parsed names list except for the head. In other words, the following relationship must holds:tail().getParsedNames() equals this.getParsedNames().sublist(1, depth)
This method is similar in purpose to
from the Java Naming and Directory Interface.Name.getSuffix
(1)- Returns:
- All elements except the first one in the in the list of parsed names.
- Since:
- GeoAPI 2.1
-
path
GenericName path()
Returns every elements of the parsed names list except for the tip. In other words, the following relationship must holds:tip().getParsedNames() equals this.getParsedNames().sublist(0, depth-1)
This method is similar in purpose to
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.
- 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 interfaceGenericName
- 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 orAuthority:Identifier
notation.- Specified by:
toString
in interfaceGenericName
- Overrides:
toString
in classObject
- Returns:
- A local-independant string representation of this name.
-
-