| public interface javax.naming Name
|
Java SE 6 |
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.
| version | 1.12 05/11/17 |
| since | 1.3 |
| Fields | |
|---|---|
| final public static long | serialVersionUID The class fingerprint that is set to indicate serialization compatibility with a previous version of the class. |
| Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public Name | add(String comp) throws InvalidNameException Details
Adds a single component to the end of this name.
| ||||||||||
| public Name | add(int posn, String comp) throws InvalidNameException Details
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.
| ||||||||||
| public Name | addAll(Name suffix) throws InvalidNameException Details
Adds the components of a name -- in order -- to the end of this name.
| ||||||||||
| public Name | addAll(int posn, Name n) throws InvalidNameException Details
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.
| ||||||||||
| public Object | clone() Details
Generates a new copy of this name.
Subsequent changes to the components of this name will not
affect the new copy, and vice versa.
| ||||||||||
| public int | compareTo(Object obj) Details
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 Object.equals(), the notion of ordering for names depends on the class that implements this interface. For example, the ordering may be based on lexicographical ordering of the name components. Specific attributes of the name, such as how it treats case, may affect the ordering. In general, two names of different classes may not be compared.
| ||||||||||
| public boolean | endsWith(Name n) Details
Determines whether this name ends with a specified suffix.
A name n is a suffix if it is equal to
getSuffix(size()-n.size()).
| ||||||||||
| public String | get(int posn) Details
Retrieves a component of this name.
| ||||||||||
| public Object | remove(int posn) throws InvalidNameException Details
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.
| ||||||||||
| public int | size() Details
Returns the number of components in this name.
| ||||||||||
| public boolean | startsWith(Name n) Details
Determines whether this name starts with a specified prefix.
A name n is a prefix if it is equal to
getPrefix(n.size()).
| ||||||||||
| Properties | |||||||
|---|---|---|---|---|---|---|---|
| public Enumeration | getAll() Details
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.
| ||||||
| public boolean | isEmpty() Details
Determines whether this name is empty.
An empty name is one with zero components.
| ||||||
| public Name | getPrefix(int posn) Details
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.
| ||||||
| public Name | getSuffix(int posn) Details
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.
| ||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2009 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|