All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.naming.Name

public interface Name
extends Serializable
The 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 hierarchical naming systems). There can be different implementations of Name (e.g. composite names, URLs, 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). An empty name has no components.


Method Index

 o appendComponent(String)
Adds a single component to the end of this name.
 o appendName(Name)
Adds the components of a name -- in order -- to the end of this name.
 o clone()
Generates a copy of this name.
 o deleteComponent(int)
Deletes a component from this name.
 o equals(Object)
Determines whether two names are equal.
 o getComponent(int)
Retrieves a component of this name.
 o getComponentCount()
Retrieves the number of components in this name.
 o getComponents()
Retrieves the components of this name as an enumeration of strings.
 o getPrefix(int)
Retrieves a name whose components consist of a prefix of the components in this name.
 o getSuffix(int)
Retrieves a name whose components consist of a suffix of the components in this name.
 o hashCode()
Computes the hash code of this name.
 o insertComponent(int, String)
Adds a single component at a specified position within this name.
 o insertName(int, Name)
Adds the components of a name -- in order -- at a specified position within this name.
 o isEmpty()
Determines whether this name is empty.
 o isPrefix(Name)
Determines whether a name is a prefix of this name.
 o isSuffix(Name)
Determines whether a name is a suffix of this name.
 o prependComponent(String)
Adds a single component to the start of this name.
 o prependName(Name)
Adds the components of a name -- in order -- to the beginning of this name.
 o toString()
Generates the string representation of this name.

Methods

 o toString
 public abstract String toString()
Generates the string representation of this name.

Returns:
A string representation of this name.
Overrides:
toString in class Object
 o equals
 public abstract boolean equals(Object obj)
Determines whether two names are equal. Two names are equal if each component in one is equal to the corresponding component in the other.

Parameters:
obj - The object to compare against.
Returns:
true if obj is equal to this name, false otherwise.
Overrides:
equals in class Object
 o hashCode
 public abstract int hashCode()
Computes the hash code of this name.

Returns:
The hash code computed using characters from this name.
Overrides:
hashCode in class Object
 o clone
 public abstract Object clone()
Generates a copy of this name.

Returns:
A copy of this name.
Overrides:
clone in class Object
 o getComponentCount
 public abstract int getComponentCount()
Retrieves the number of components in this name.

Returns:
The number of components in this name.
 o isEmpty
 public abstract boolean isEmpty()
Determines whether this name is empty.

Returns:
true if this name is empty, false otherwise.
 o getComponents
 public abstract StringEnumeration getComponents()
Retrieves the components of this name as an enumeration of strings.

Returns:
An enumeration of the components of this name.
 o getComponent
 public abstract String getComponent(int posn)
Retrieves a component of this name.

Parameters:
posn - The 0-based index of the component to retrieve. Must be in the range [0,getComponentCount()).
Returns:
The component at index posn.
 o getPrefix
 public abstract Name getPrefix(int posn)
Retrieves a name whose components consist of a prefix of the components in this name.

Parameters:
posn - The 0-based index of the component at which to stop. Must be in the range [0,getComponentCount()].
Returns:
A name consisting of the components at indexes in the range [0,posn).
 o getSuffix
 public abstract Name getSuffix(int posn)
Retrieves a name whose components consist of a suffix of the components in this name.

Parameters:
posn - The 0-based index of the component at which to start. Must be in the range [0,getComponentCount()].
Returns:
A name consisting of the components at indexes in the range [posn,getComponentCount()). If posn is equal to getComponentCount(), an empty name is returned.
 o isPrefix
 public abstract boolean isPrefix(Name n)
Determines whether a name is a prefix of this name. A name 'n' is a prefix if it is equal to getPrefix(n.getComponentCount()).

Parameters:
n - The name to check.
Returns:
true if n is a prefix of this name, false otherwise.
 o isSuffix
 public abstract boolean isSuffix(Name n)
Determines whether a name is a suffix of this name. A name 'n' is a suffix if it it is equal to getSuffix(getComponentCount()-n.getComponentCount()).

Parameters:
n - The name to check.
Returns:
true if n is a suffix of this name, false otherwise.
 o prependName
 public abstract void prependName(Name prefix) throws InvalidNameException
Adds the components of a name -- in order -- to the beginning of this name.

Parameters:
prefix - The components to add.
 o appendName
 public abstract void appendName(Name suffix) throws InvalidNameException
Adds the components of a name -- in order -- to the end of this name.

Parameters:
suffix - The components to add.
 o insertName
 public abstract void insertName(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 to accommodate the new components.

Parameters:
n - The components to add.
posn - The index in this name at which to add the new components. Must be in the range [0,getComponentCount()].
 o prependComponent
 public abstract void prependComponent(String comp) throws InvalidNameException
Adds a single component to the start of this name.

Parameters:
comp - The component to add.
 o appendComponent
 public abstract void appendComponent(String comp) throws InvalidNameException
Adds a single component to the end of this name.

Parameters:
comp - The component to add.
 o insertComponent
 public abstract void insertComponent(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 by one to accommodate the new component.

Parameters:
comp - The component to add.
posn - The index at which to add the new component. Must be in the range [0,getComponentCount()].
 o deleteComponent
 public abstract void deleteComponent(int posn) throws InvalidNameException
Deletes a component from this name.

Parameters:
posn - The index of the component to delete. Must be in the range [0,getComponentCount()].

All Packages  Class Hierarchy  This Package  Previous  Next  Index