All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.naming.directory.AttributeSet

java.lang.Object
   |
   +----java.naming.directory.AttributeSet

public class AttributeSet
extends Object
implements Serializable
In a directory, named objects can have associated with them attributes. The AttributeSet represents a collection of attributes. For example, you can request from the directory the attributes associated with an object. Those attributes are returned in the form of an AttributeSet. Note that updates to AttributeSet (such as adding or removing an attribute) does not affect the corresponding representation in the directory. Updates to the directory can only be effected using operations in the DSContext interface.


Constructor Index

 o AttributeSet()

Method Index

 o add(Attribute)
Adds a new attribute to this attribute set.
 o add(String, Object)
Adds a new attribute to this attribute set.
 o get(String)
Retrieves the attribute with the given attribute id from this set.
 o getAttributeCount()
Retrieves the number of attributes in this attribute set.
 o getAttributeIds()
Retrieves an enumeration of the ids of the attributes in this attribute set.
 o getAttributes()
Retrieves an enumeration of the attributes in this attribute set.
 o remove(String)
Removes the attribute with the attribute id 'attrId' from this attribute set.
 o replace(Attribute)
Replaces the attribute identified by the attribute id of 'attr' to be attr.
 o replace(String, Object)
Changes the value of the attribute identified by 'attrId' to the value 'val'.

Constructors

 o AttributeSet
 public AttributeSet()

Methods

 o getAttributeCount
 public int getAttributeCount()
Retrieves the number of attributes in this attribute set.

Returns:
The number of attributes in this attribute set.
 o get
 public Attribute get(String attrId)
Retrieves the attribute with the given attribute id from this set. Returns null if not found.

Parameters:
attrId - The id of the attribute to retrieve.
Returns:
The attribute identified by attrId; null if not found.
 o getAttributes
 public AttributeEnumeration getAttributes()
Retrieves an enumeration of the attributes in this attribute set.

Returns:
An enumeration of the attributes in this attribute set.
 o getAttributeIds
 public StringEnumeration getAttributeIds()
Retrieves an enumeration of the ids of the attributes in this attribute set.

Returns:
An enumeration of the attributes' ids in this attribute set.
 o add
 public void add(String attrId,
                 Object val) throws AttributeInUseException
Adds a new attribute to this attribute set.

Parameters:
attrId - The id of the attribute to add.
val - The value of the attribute to add.
Throws: AttributeInUseException
If attrId is already in this attribute set.
 o add
 public void add(Attribute attr) throws AttributeInUseException
Adds a new attribute to this attribute set.

Parameters:
attr - The attribute to add.
Throws: AttributeInUseException
If attr is already in this attribute set.
 o replace
 public void replace(String attrId,
                     Object val)
Changes the value of the attribute identified by 'attrId' to the value 'val'. If attribute does not exist, add it to attribute set.

Parameters:
attrId - The id of the attribute to update.
val - The new value of 'attrId'.
 o replace
 public void replace(Attribute attr)
Replaces the attribute identified by the attribute id of 'attr' to be attr. If attribute does not exist, add it to attribute set.

Parameters:
attr - The new attribute to be added to this attribute set.
 o remove
 public void remove(String attrId)
Removes the attribute with the attribute id 'attrId' from this attribute set. If the attribute does not exist, ignore.

Parameters:
attrId - The id of the attribute to remove.

All Packages  Class Hierarchy  This Package  Previous  Next  Index