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.
-
attrId
-
-
values
-
-
Attribute(String)
- Constructs a new instance of an attribute.
-
Attribute(String, Object)
- Constructs a new instance of an attribute.
-
addValue(Object)
- Adds a new value to attribute.
-
clone()
- Makes a copy of this attribute.
-
contains(Object)
- Determines whether a value is in this attribute.
-
equals(Object)
- Determines whether obj is equal to this attribute.
-
getAttributeDefinition()
- Retrieves this attribute's schema definition.
-
getAttributeId()
- Retrieves the id of this attribute.
-
getAttributeSyntaxDefinition()
- Retrieves the syntax definition associated with this attribute.
-
getValueCount()
-
Retrieves the number of values in this attribute.
-
getValues()
- Retrieves an enumeration of this attribute's values.
-
removeAllValues()
- Removes all values from this attribute.
-
removeValue(Object)
- Removes a specified value from this attribute.
-
replaceValue(Object)
- Replaces any existing value(s) with the supplied new value.
-
toString()
- Generates the string representation of this attribute.
attrId
protected String attrId
values
protected Vector values
Attribute
public Attribute(String id)
- Constructs a new instance of an attribute.
- Parameters:
- id - The attribute's id.
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.
clone
public Object clone()
- Makes a copy of this attribute.
- Returns:
- A copy of this attribute.
- Overrides:
- clone in class Object
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
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
getValues
public Enumeration getValues() throws NamingException
- Retrieves an enumeration of this attribute's values.
- Returns:
- An enumeration of this attribute's values.
getValueCount
public int getValueCount()
- Retrieves the number of values in this attribute.
- Returns:
- The number of values in this attribute.
getAttributeId
public String getAttributeId()
- Retrieves the id of this attribute.
- Returns:
- The id of this attribute.
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.
addValue
public void addValue(Object attrVal)
- Adds a new value to attribute.
- Parameters:
- attrVal - The new value to add.
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.
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.
removeAllValues
public void removeAllValues()
- Removes all values from this attribute.
getAttributeSyntaxDefinition
public DSContext getAttributeSyntaxDefinition()
- Retrieves the syntax definition associated with this attribute.
- Returns:
- This attribute's syntax definition.
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