Name interface represents a generic name -- an ordered
sequence of components. It can be a composite name (names that
span multiple namespaces), or a compound name (names that are
used within individual hierarchical naming systems).
There can be different implementations of Name; for example,
composite names, URLs, or namespace-specific compound names.
The components of a name are numbered. The indexes of a name with N components range from 0 up to, but not including, N. This range may be written as [0,N). The most significant component is at index 0. An empty name has no components.
None of the methods in this interface accept null as a valid value for a parameter that is a name or a name component. Likewise, methods that return a name or name component never return null.
An instance of a Name may not be synchronized against
concurrent multithreaded access if that access is not read-only.
| Modifier and Type | Field and Description |
|---|---|
| public static final long | serialVersionUID
Deprecated
A The class fingerprint that is set to indicate
serialization compatibility with a previous
version of the class.
serialVersionUID field in an interface is
ineffectual. Do not use; no replacement.
|
| Modifier and Type | Method and Description |
|---|---|
| public Name | |
| public Name | |
| public Name | |
| public Name | |
| public Object | |
| public int | Returns: a negative integer, zero, or a positive integer as this name is less than, equal to, or greater than the given namethe non-null object to compare against. obj)Redeclares java. Compares this name with another name for order. |
| public boolean | |
| public String | Returns: the component at index posnthe 0-based index of the component to retrieve.
Must be in the range [0,size()). posn)Retrieves a component of this name. |
| public Enumeration | Returns: an enumeration of the components of this name, each a stringRetrieves the components of this name as an enumeration of strings. |
| public Name | Returns: a name consisting of the components at indexes in the range [0,posn).the 0-based index of the component at which to stop.
Must be in the range [0,size()]. posn)Creates a name whose components consist of a prefix of the components of this name. |
| public Name | Returns: a name consisting of the components at indexes in the range [posn,size()). If posn is equal to size(), an empty name is returned.the 0-based index of the component at which to start.
Must be in the range [0,size()]. posn)Creates a name whose components consist of a suffix of the components in this name. |
| public boolean | |
| public Object | Returns: the component removed (a String)the index of the component to remove.
Must be in the range [0,size()). posn)Removes a component from this name. |
| public int | |
| public boolean | Returns: true ifn is a prefix of this name, false otherwisethe name to check n)Determines whether this name starts with a specified prefix. |
| serialVersionUID | back to summary |
|---|---|
| public static final long serialVersionUID
Deprecated A The class fingerprint that is set to indicate serialization compatibility with a previous version of the class. | |
| add | back to summary |
|---|---|
| public Name add(String comp) throws InvalidNameException Adds a single component to the end of this name.
| |
| add | back to summary |
|---|---|
| public Name add(int posn, String comp) throws InvalidNameException Adds a single component at a specified position within this name. Components of this name at or after the index of the new component are shifted up by one (away from index 0) to accommodate the new component.
| |
| addAll | back to summary |
|---|---|
| public Name addAll(Name suffix) throws InvalidNameException Adds the components of a name -- in order -- to the end of this name.
| |
| addAll | back to summary |
|---|---|
| public Name addAll(int posn, Name n) throws InvalidNameException Adds the components of a name -- in order -- at a specified position within this name. Components of this name at or after the index of the first new component are shifted up (away from 0) to accommodate the new components.
| |
| clone | back to summary |
|---|---|
| public Object clone() Generates a new copy of this name. Subsequent changes to the components of this name will not affect the new copy, and vice versa.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object obj) Redeclares java. Compares this name with another name for order. Returns a negative integer, zero, or a positive integer as this name is less than, equal to, or greater than the given name. As with
| |
| endsWith | back to summary |
|---|---|
| public boolean endsWith(Name n) Determines whether this name ends with a specified suffix.
A name
| |
| get | back to summary |
|---|---|
| public String get(int posn) Retrieves a component of this name.
| |
| getAll | back to summary |
|---|---|
| public Enumeration Retrieves the components of this name as an enumeration of strings. The effect on the enumeration of updates to this name is undefined. If the name has zero components, an empty (non-null) enumeration is returned.
| |
| getPrefix | back to summary |
|---|---|
| public Name getPrefix(int posn) Creates a name whose components consist of a prefix of the components of this name. Subsequent changes to this name will not affect the name that is returned and vice versa.
| |
| getSuffix | back to summary |
|---|---|
| public Name getSuffix(int posn) Creates a name whose components consist of a suffix of the components in this name. Subsequent changes to this name do not affect the name that is returned and vice versa.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Determines whether this name is empty. An empty name is one with zero components.
| |
| remove | back to summary |
|---|---|
| public Object remove(int posn) throws InvalidNameException Removes a component from this name. The component of this name at the specified position is removed. Components with indexes greater than this position are shifted down (toward index 0) by one.
| |
| size | back to summary |
|---|---|
| public int size() Returns the number of components in this name.
| |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(Name n) Determines whether this name starts with a specified prefix.
A name
| |