java.lang.Objectjavax.naming.directory.BasicAttribute
All Implemented Interfaces:
Attribute
This implementation does not support the schema methods getAttributeDefinition() and getAttributeSyntaxDefinition(). They simply throw OperationNotSupportedException. Subclasses of BasicAttribute should override these methods if they support them.
The BasicAttribute class by default uses Object.equals() to determine equality of attribute values when testing for equality or when searching for values, except when the value is an array. For an array, each element of the array is checked using Object.equals(). Subclasses of BasicAttribute can make use of schema information when doing similar equality checks by overriding methods in which such use of schema is meaningful. Similarly, the BasicAttribute class by default returns the values passed to its constructor and/or manipulated using the add/remove methods. Subclasses of BasicAttribute can override get() and getAll() to get the values dynamically from the directory (or implement the Attribute interface directly instead of subclassing BasicAttribute).
Note that updates to BasicAttribute (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 DirContext interface.
A BasicAttribute instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a BasicAttribute should lock the object.
Rosanna
- LeeScott
- Seligman1.3
- Nested Class Summary: | ||
---|---|---|
class | BasicAttribute.ValuesEnumImpl |
Field Summary | ||
---|---|---|
protected String | attrID | Holds the attribute's id. It is initialized by the public constructor and
cannot be null unless methods in BasicAttribute that use attrID
have been overridden.
|
protected transient Vector<Object> | values | Holds the attribute's values. Initialized by public constructors. Cannot be null unless methods in BasicAttribute that use values have been overridden. |
protected boolean | ordered | A flag for recording whether this attribute's values are ordered.
|
Constructor: |
---|
|
|
|
|
Method from javax.naming.directory.BasicAttribute Summary: |
---|
add, add, clear, clone, contains, equals, get, get, getAll, getAttributeDefinition, getAttributeSyntaxDefinition, getID, hashCode, isOrdered, remove, remove, set, size, toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.naming.directory.BasicAttribute Detail: |
---|
By default, Object.equals() is used when comparing attrVal with this attribute's values except when attrVal is an array. For an array, each element of the array is checked using Object.equals(). A subclass may use schema information to determine equality. |
|
|
|
By default, Object.equals() is used when comparing attrVal with this attribute's values except when attrVal is an array. For an array, each element of the array is checked using Object.equals(). A subclass may use schema information to determine equality. |
By default Object.equals() is used when comparing the attribute id and its values except when a value is an array. For an array, each element of the array is checked using Object.equals(). A subclass may override this to make use of schema syntax information and matching rules, which define what it means for two attributes to be equal. How and whether a subclass makes use of the schema information is determined by the subclass. If a subclass overrides equals(), it should also override hashCode() such that two attributes that are equal have the same hash code. |
By default, the value returned is one of those passed to the constructor and/or manipulated using the add/replace/remove methods. A subclass may override this to retrieve the value dynamically from the directory. |
|
By default, the values returned are those passed to the constructor and/or manipulated using the add/replace/remove methods. A subclass may override this to retrieve the values dynamically from the directory. |
This method by default throws OperationNotSupportedException. A subclass should override this method if it supports schema. |
This method by default throws OperationNotSupportedException. A subclass should override this method if it supports schema. |
|
The hash code is computed by adding the hash code of the attribute's id and that of all of its values except for values that are arrays. For an array, the hash code of each element of the array is summed. If a subclass overrides hashCode(), it should override equals() as well so that two attributes that are equal have the same hash code. |
|
By default, Object.equals() is used when comparing attrVal with this attribute's values except when attrVal is an array. For an array, each element of the array is checked using Object.equals(). A subclass may use schema information to determine equality. |
|
|
|
|