| java.lang.Object javax.naming.directory.BasicAttribute
BasicAttribute | public class BasicAttribute implements Attribute(Code) | | A simple attribute of a directory entry.
A basic attribute does not have any schema associated with it, and attempts
to get the schema result in an OperationNotSupportedException
being thrown.
The definition of equals for an attribute is simply
Object.equals
on the value, except for values that are collections where the definition of
equals is an equivalence test (i.e. the collection contains
the same number of elements, and each has an equal element in the other
collection). For an array, Object.equals is used on each array
element.
Note that updates to a basic attribute do not update the directory itself --
updates to a directory are only possible through the
DirContext interface. BasicAttribute does not get its values dynamically
from the directory. It uses the values passed to the constructor or add and
remove methods.
See Also: Attribute |
Constructor Summary | |
public | BasicAttribute(String id) Constructs an unordered BasicAttribute instance with the
supplied identifier and no values. | public | BasicAttribute(String id, boolean flag) Constructs a BasicAttribute instance with the supplied
identifier and no values. | public | BasicAttribute(String id, Object val) Constructs an unordered BasicAttribute instance with the
supplied identifier and one value. | public | BasicAttribute(String id, Object val, boolean flag) Constructs a BasicAttribute instance with the supplied
identifier and one value. |
attrID | protected String attrID(Code) | | The attribute identifier. It is initialized by the public constructors
and is required to be not null.
|
ordered | protected boolean ordered(Code) | | Flag showing whether the values of the attribute are ordered.
|
serialVersionUID | final static long serialVersionUID(Code) | | |
values | protected transient Vector<Object> values(Code) | | Vector containing the attribute's values. This is
initialized by the public constructor and is required to be not null.
|
BasicAttribute | public BasicAttribute(String id)(Code) | | Constructs an unordered BasicAttribute instance with the
supplied identifier and no values.
Parameters: id - the attribute ID |
BasicAttribute | public BasicAttribute(String id, boolean flag)(Code) | | Constructs a BasicAttribute instance with the supplied
identifier and no values. The supplied flag controls whether the values
will be ordered or not.
Parameters: id - the attribute ID Parameters: flag - Indicates whether the values are ordered or not. |
BasicAttribute | public BasicAttribute(String id, Object val)(Code) | | Constructs an unordered BasicAttribute instance with the
supplied identifier and one value.
Parameters: id - the attribute ID Parameters: val - the first attribute value |
BasicAttribute | public BasicAttribute(String id, Object val, boolean flag)(Code) | | Constructs a BasicAttribute instance with the supplied
identifier and one value. The supplied flag controls whether the values
will be ordered or not.
Parameters: id - the attribute ID Parameters: val - the first attribute value Parameters: flag - Indicates whether the values are ordered or not. |
clear | public void clear()(Code) | | |
equals | public boolean equals(Object obj)(Code) | | Returns true if this BasicAttribute instance is equal to
the supplied object obj . Two attributes are considered
equal if they have equal identifiers, schemas and values. BasicAttribute
uses no schema.
Object.equals is used to test equality of identifiers and
values. For array values Object.equals is called on every
array element.
Parameters: obj - the object to be compared with true if this object is equal to obj , otherwisefalse |
hashCode | public int hashCode()(Code) | | Returns the hashcode for this BasicAttribute instance. The
result is calculated by summing the hashcodes for the identifier and each
of the values, except for array values, where the hashcodes for each
array element are summed.
the hashcode of this BasicAttribute instance |
isOrdered | public boolean isOrdered()(Code) | | |
toString | public String toString()(Code) | | Returns the string representation of this BasicAttribute
instance. The result contains the ID and the string representation of
each value.
the string representation of this object |
|
|