aicas logoJamaica 3.2 release 62

javax.naming
Class CompositeName

java.lang.Object
  extended by javax.naming.CompositeName
All Implemented Interfaces:
Serializable, Cloneable, Comparable, Name

public class CompositeName
extends Object
implements Name, Cloneable, Serializable

See Also:
Serialized Form

Constructor Summary
  CompositeName()
           
protected CompositeName(Enumeration comps)
           
  CompositeName(String n)
           
 
Method Summary
 Name add(int posn, String comp)
          Inserts the given String component to this Name at the given index.
 Name add(String comp)
          Adds the given String component to the end of this Name.
 Name addAll(int posn, Name n)
          Inserts all the components of the given Name to this Name at the given index.
 Name addAll(Name suffix)
          Adds all the components of the given Name to the end of this Name.
 Object clone()
          clone creates a shallow clone of this.
 int compareTo(Object obj)
          Compares the given object to this Name.
 boolean endsWith(Name n)
          Returns true if this Name ends with the components of the given Name, false otherwise.
 boolean equals(Object obj)
          equals compares this object to another object.
 String get(int posn)
          Gets the component at the given index.
 Enumeration getAll()
          Returns a non-null (but possibly empty) Enumeration of the components of the Name as Strings.
 Name getPrefix(int posn)
          Returns the components till the given index as a Name.
 Name getSuffix(int posn)
          Returns the components from the given index till the end as a Name.
 int hashCode()
          hashCode returns a hash code for this object.
 boolean isEmpty()
          Returns true if the number of components of this Name is zero, false otherwise.
 Object remove(int posn)
          Removes the component at the given index from this Name.
 int size()
          Returns the number of components of this Name.
 boolean startsWith(Name n)
          Returns true if this Name starts with the components of the given Name, false otherwise.
 String toString()
          toString creates a printable string that represents this object for debugging purposes.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeName

public CompositeName()

CompositeName

protected CompositeName(Enumeration comps)

CompositeName

public CompositeName(String n)
              throws InvalidNameException
Throws:
InvalidNameException
Method Detail

add

public Name add(int posn,
                String comp)
         throws InvalidNameException
Description copied from interface: Name
Inserts the given String component to this Name at the given index. The method modifies the current Name and then returns it.

Specified by:
add in interface Name
Throws:
InvalidNameException - if the given String is not a valid component for this Name.

add

public Name add(String comp)
         throws InvalidNameException
Description copied from interface: Name
Adds the given String component to the end of this Name. The method modifies the current Name and then returns it.

Specified by:
add in interface Name
Throws:
InvalidNameException - if the given String is not a valid component for this Name.

addAll

public Name addAll(int posn,
                   Name n)
            throws InvalidNameException
Description copied from interface: Name
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.

Specified by:
addAll in interface Name
Throws:
InvalidNameException - if any of the given components is not a valid component for this Name.

addAll

public Name addAll(Name suffix)
            throws InvalidNameException
Description copied from interface: Name
Adds all the components of the given Name to the end of this Name. The method modifies the current Name and then returns it.

Specified by:
addAll in interface Name
Throws:
InvalidNameException - if any of the given components is not a valid component for this Name.

clone

public Object clone()
Description copied from class: Object
clone creates a shallow clone of this.

Specified by:
clone in interface Name
Overrides:
clone in class Object
Returns:
a clone of this object.

compareTo

public int compareTo(Object obj)
Description copied from interface: Name
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.

Specified by:
compareTo in interface Comparable
Specified by:
compareTo in interface Name
Parameters:
obj - the other object
Returns:
a value <0 if this < o, 0 if this == o and a value > 0 if this > o.

endsWith

public boolean endsWith(Name n)
Description copied from interface: Name
Returns true if this Name ends with the components of the given Name, false otherwise.

Specified by:
endsWith in interface Name

equals

public boolean equals(Object obj)
Description copied from class: Object
equals compares this object to another object.

Equals must be symmetric (a.equals(b) == b.equals(a)), reflexive (a.equals(a)==true) and transitive (a.equals(b) && b.equals(c) IMPLIES (a.equals(c))) and not change over time (a.equals(b) == a.equals(b)). a.equals(null) should always return false.

If a.equals(b) is true for two objects a and b, then a.hashCode()==b.hashCode() must hold.

The default implementation of equals returns this==other.

Overrides:
equals in class Object
Parameters:
obj - the other object.
Returns:
if this and other are considered equal.

get

public String get(int posn)
Description copied from interface: Name
Gets the component at the given index.

Specified by:
get in interface Name

getAll

public Enumeration getAll()
Description copied from interface: Name
Returns a non-null (but possibly empty) Enumeration of the components of the Name as Strings.

Specified by:
getAll in interface Name

getPrefix

public Name getPrefix(int posn)
Description copied from interface: Name
Returns the components till the given index as a Name. The returned Name can be modified without changing the original.

Specified by:
getPrefix in interface Name

getSuffix

public Name getSuffix(int posn)
Description copied from interface: Name
Returns the components from the given index till the end as a Name. The returned Name can be modified without changing the original.

Specified by:
getSuffix in interface Name

hashCode

public int hashCode()
Description copied from class: Object
hashCode returns a hash code for this object. The hash code must be equal for two objects a and b if a.equals(b) is true.

The default implementation returns System.identityHashCode(this).

Overrides:
hashCode in class Object
Returns:
a hash code value.

isEmpty

public boolean isEmpty()
Description copied from interface: Name
Returns true if the number of components of this Name is zero, false otherwise.

Specified by:
isEmpty in interface Name

remove

public Object remove(int posn)
              throws InvalidNameException
Description copied from interface: Name
Removes the component at the given index from this Name. The method modifies the current Name and then returns it.

Specified by:
remove in interface Name
Throws:
InvalidNameException - if the given String is not a valid component for this Name.

size

public int size()
Description copied from interface: Name
Returns the number of components of this Name. The returned number can be zero.

Specified by:
size in interface Name

startsWith

public boolean startsWith(Name n)
Description copied from interface: Name
Returns true if this Name starts with the components of the given Name, false otherwise.

Specified by:
startsWith in interface Name

toString

public String toString()
Description copied from class: Object
toString creates a printable string that represents this object for debugging purposes.

The default implementation returns getClass().getName() + '@' + Integer.toHexString(hashCode()).

Overrides:
toString in class Object
Returns:
a string identifying this object.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.