javax.naming
Interface Name
java.lang.Object
|
+--java.io.Serializable
|
+--javax.naming.Name
All Implemented Interfaces:
Serializable
Interface descriping a name build up from different components.
The components are represented as
Strings which are
ordered from most significant to least significant. There are methods to
get the number of components. Methods to get a particular component or group
of components. Components can be added as
Strings or
Names and a component can be removed from any position in the
Name.
A
Name can be compared to another
Name and it can
be checked if a particular
Name starts or ends with the same
components as another
Name. Finally
Names can be
serialized and cloned.
Since Names can be empty (have no components) methods that
return a Name will never return null.
Since:Authors:- Anthony Green (green@redhat.com)
- Mark Wielaard (mark@klomp.org)
add
public Name add(int posn, java.lang.String comp) Inserts the given String component to this Name
at the given index. The method modifies the current Name and
then returns it.
Parameters:
Throws:
add
public Name add(java.lang.String comp) Adds the given String component to the end of this
Name. The method modifies the current Name and
then returns it.
Parameters:
Throws:
addAll
public Name addAll(int posn, javax.naming.Name n) Inserts all the components of the given Name to this
Name at the given index. The method modifies the current
Name and then returns it.
Parameters:
Throws:
addAll
public Name addAll(javax.naming.Name suffix) Adds all the components of the given Name to the end of this
Name. The method modifies the current Name and
then returns it.
Parameters:
Throws:
clone
public Object clone() Returns a clone of this Name. It will be a deep copy of
all the components of the Name so that changes to components
of the components does not change the component in this Name.
compareTo
public int compareTo(java.lang.Object obj) Compares the given object to this Name.
Returns a negative value if the given Object is smaller then
this Name, a positive value if the Object is
bigger, and zero if the are equal. If the Object is not of
a class that can be compared to the class of this Name then
a ClassCastException is thrown. Note that it is not
guaranteed that Names implemented in different classes can
be compared. The definition of smaller, bigger and equal is up to the
actual implementing class.
Parameters:
endsWith
public boolean endsWith(javax.naming.Name name) Returns true if this Name ends with the
components of the given Name, false otherwise.
Parameters:
get
public String get(int i) Gets the component at the given index.
Parameters:
Throws:
getAll
public Enumeration getAll() Returns a non-null (but possibly empty) Enumeration of the
components of the Name as Strings.
getPrefix
public Name getPrefix(int i) Returns the components till the given index as a Name.
The returned Name can be modified without changing the
original.
Parameters:
Throws:
getSuffix
public Name getSuffix(int i) Returns the components from the given index till the end as a
Name.
The returned Name can be modified without changing the
original.
Parameters:
Throws:
isEmpty
public boolean isEmpty() Returns true if the number of components of this
Name is zero, false otherwise.
remove
public Object remove(int posn) Removes the component at the given index from this Name.
The method modifies the current Name and then returns it.
Parameters:
Throws:
size
public int size() Returns the number of components of this Name.
The returned number can be zero.
startsWith
public boolean startsWith(javax.naming.Name name) Returns true if this Name starts with the
components of the given Name, false otherwise.
Parameters:
Strings which are ordered from most significant to least significant. There are methods to get the number of components. Methods to get a particular component or group of components. Components can be added asStrings orNames and a component can be removed from any position in theName. ANamecan be compared to anotherNameand it can be checked if a particularNamestarts or ends with the same components as anotherName. FinallyNames can be serialized and cloned.Since
Names can be empty (have no components) methods that return aNamewill never returnnull.