| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
BasicAttributes attr = new BasicAttributes();
Based on 30 examples
public class BasicAttributes extends Object implements Attributes
This class provides a basic implementation of the Attributes interface.
BasicAttributes is either case-sensitive or case-insensitive (case-ignore). This property is determined at the time the BasicAttributes constructor is called. In a case-insensitive BasicAttributes, the case of its attribute identifiers is ignored when searching for an attribute, or adding attributes. In a case-sensitive BasicAttributes, the case is significant.
When the BasicAttributes class needs to create an Attribute, it uses BasicAttribute. There is no other dependency on BasicAttribute.
Note that updates to BasicAttributes (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 DirContext interface.
A BasicAttributes instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single BasicAttributes instance should lock the object.
Constructor Summary | |
---|---|
Constructs a new instance of Attributes. |
|
BasicAttributes(boolean ignoreCase) Constructs a new instance of Attributes. |
|
BasicAttributes(String attrID, Object val) Constructs a new instance of Attributes with one attribute. |
|
BasicAttributes(String attrID, Object val, boolean ignoreCase) Constructs a new instance of Attributes with one attribute. |
Method Summary | |
---|---|
Object |
clone() Creates and returns a copy of this object. |
boolean |
Determines whether this BasicAttributes is equal to another Attributes Two Attributes are equal if they are both instances of Attributes, treat the case of attribute IDs the same way, and contain the same attributes. |
Attribute |
|
NamingEnumeration |
getAll() |
NamingEnumeration |
getIDs() |
int |
hashCode() Calculates the hash code of this BasicAttributes. |
boolean |
|
Attribute |
|
Attribute |
|
Attribute |
|
int |
size() |
String |
toString() Generates the string representation of this attribute set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicAttributes()
public BasicAttributes(boolean ignoreCase)
ignoreCase
is true, the character case of attribute
identifiers is ignored; otherwise the case is significant.
ignoreCase
- true means this attribute set will ignore
the case of its attribute identifiers
when retrieving or adding attributes;
false means case is respected.public BasicAttributes(String attrID, Object val)
attrID
- non-null The id of the attribute to add.val
- The value of the attribute to add. If null, a null
value is added to the attribute.public BasicAttributes(String attrID, Object val, boolean ignoreCase)
ignoreCase
is true, the character case of attribute
identifiers is ignored; otherwise the case is significant.
attrID
- non-null The id of the attribute to add.
If this attribute set ignores the character
case of its attribute ids, the case of attrID
is ignored.val
- The value of the attribute to add. If null, a null
value is added to the attribute.ignoreCase
- true means this attribute set will ignore
the case of its attribute identifiers
when retrieving or adding attributes;
false means case is respected.Method Detail |
---|
public Object clone()
clone
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- the possibly null object to compare against.public Attribute get(String attrID)
attrID
public NamingEnumeration getAll()
public NamingEnumeration getIDs()
public int hashCode()
The hash code is computed by adding the hash code of the attributes of this object. If this BasicAttributes ignores case of its attribute IDs, one is added to the hash code. If a subclass overrides hashCode(), it should override equals() as well so that two Attributes instances that are equal have the same hash code.
hashCode
in class Object
public boolean isCaseIgnored()
public Attribute put(Attribute attr)
attr
public Attribute put(String attrID, Object val)
attrID
val
public Attribute remove(String attrID)
attrID
public int size()
public String toString()
toString
in class Object
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |