All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.naming.directory.Attribute

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

public class Attribute
extends Object
implements Cloneable, Serializable
In a directory, named objects can have associated with them attributes. The Attribute class represents an attribute associated with a named object. It can be a single-valued attribute or a multi-valued attribute. Some directories support schemas. The Attribute class contains methods that return schema information about an instance of Attribute. Note that updates to Attribute (such as adding or removing a value) does not affect the corresponding representation of the attribute in the directory. Updates to the directory can only be effected using operations in the DSContext interface.


Variable Index

 o attrId
 o values

Constructor Index

 o Attribute(String)
Constructs a new instance of an attribute.
 o Attribute(String, Object)
Constructs a new instance of an attribute.

Method Index

 o addValue(Object)
Adds a new value to attribute.
 o clone()
Makes a copy of this attribute.
 o contains(Object)
Determines whether a value is in this attribute.
 o equals(Object)
Determines whether obj is equal to this attribute.
 o getAttributeDefinition()
Retrieves this attribute's schema definition.
 o getAttributeId()
Retrieves the id of this attribute.
 o getAttributeSyntaxDefinition()
Retrieves the syntax definition associated with this attribute.
 o getValueCount()
Retrieves the number of values in this attribute.
 o getValues()
Retrieves an enumeration of this attribute's values.
 o removeAllValues()
Removes all values from this attribute.
 o removeValue(Object)
Removes a specified value from this attribute.
 o replaceValue(Object)
Replaces any existing value(s) with the supplied new value.
 o toString()
Generates the string representation of this attribute.

Variables

 o attrId
 protected String attrId
 o values
 protected Vector values

Constructors

 o Attribute
 public Attribute(String id)
Constructs a new instance of an attribute.

Parameters:
id - The attribute's id.
 o Attribute
 public Attribute(String id,
                  Object value)
Constructs a new instance of an attribute.

Parameters:
id - The attribute's id.
value - The attribute's value.

Methods

 o clone
 public Object clone()
Makes a copy of this attribute.

Returns:
A copy of this attribute.
Overrides:
clone in class Object
 o equals
 public boolean equals(Object obj)
Determines whether obj is equal to this attribute. Two attributes are equal if their attribute-ids, syntaxes and values are equal.

Parameters:
obj - The object to check.
Returns:
true if obj is equal to this attribute; false otherwise.
Overrides:
equals in class Object
 o toString
 public String toString()
Generates the string representation of this attribute. The string consists of the attribute's id and its values.

Returns:
The string representation of this attribute.
Overrides:
toString in class Object
 o getValues
 public Enumeration getValues() throws NamingException
Retrieves an enumeration of this attribute's values.

Returns:
An enumeration of this attribute's values.
 o getValueCount
 public int getValueCount()
Retrieves the number of values in this attribute.

Returns:
The number of values in this attribute.
 o getAttributeId
 public String getAttributeId()
Retrieves the id of this attribute.

Returns:
The id of this attribute.
 o contains
 public boolean contains(Object attrVal)
Determines whether a value is in this attribute.

Parameters:
attrVal - The value to check.
Returns:
true if attrVal is one of this attribute's values; false otherwise.
 o addValue
 public void addValue(Object attrVal)
Adds a new value to attribute.

Parameters:
attrVal - The new value to add.
 o replaceValue
 public void replaceValue(Object attrVal)
Replaces any existing value(s) with the supplied new value.

Parameters:
attrVal - The new value that this attribute will have.
 o removeValue
 public void removeValue(Object attrval)
Removes a specified value from this attribute. If value does not exist, just ignore.

Parameters:
attrVal - The value to remove from this attribute.
 o removeAllValues
 public void removeAllValues()
Removes all values from this attribute.

 o getAttributeSyntaxDefinition
 public DSContext getAttributeSyntaxDefinition()
Retrieves the syntax definition associated with this attribute.

Returns:
This attribute's syntax definition.
 o getAttributeDefinition
 public DSContext getAttributeDefinition()
Retrieves this attribute's schema definition.

Returns:
This attribute's schema definition.

All Packages  Class Hierarchy  This Package  Previous  Next  Index