org.apache.directory.shared.ldap.message
Class LockableAttributesImpl

java.lang.Object
  extended byorg.apache.directory.shared.ldap.message.LockableAttributesImpl
All Implemented Interfaces:
javax.naming.directory.Attributes, java.lang.Cloneable, java.io.Serializable

public class LockableAttributesImpl
extends java.lang.Object
implements javax.naming.directory.Attributes

A case-insensitive Lockable JNDI Attributes implementation.

Version:
$Rev: 379008 $
Author:
Apache Directory Project
See Also:
Serialized Form

Constructor Summary
LockableAttributesImpl()
          Creates a LockableAttributes without a parent Lockable.
 
Method Summary
 java.lang.Object clone()
          Makes a shallow copy of the attribute set.
 boolean equals(java.lang.Object obj)
          Checks to see if this Attributes implemenation is equivalent to another.
 javax.naming.directory.Attribute get(java.lang.String attrId)
          Retrieves the attribute with the given attribute id from the attribute set.
 javax.naming.NamingEnumeration getAll()
          Retrieves an enumeration of the attributes in the attribute set.
 javax.naming.NamingEnumeration getIDs()
          Retrieves an enumeration of the ids of the attributes in the attribute set.
 boolean isCaseIgnored()
          Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes.
 javax.naming.directory.Attribute put(javax.naming.directory.Attribute attr)
          Adds a new attribute to the attribute set.
 javax.naming.directory.Attribute put(java.lang.String attrId, java.lang.Object val)
          Adds a new attribute to the attribute set.
 javax.naming.directory.Attribute remove(java.lang.String attrId)
          Removes the attribute with the attribute id 'attrID' from the attribute set.
 int size()
          Retrieves the number of attributes in the attribute set.
 java.lang.String toString()
          Prints out the attributes as an LDIF.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LockableAttributesImpl

public LockableAttributesImpl()
Creates a LockableAttributes without a parent Lockable.

Method Detail

isCaseIgnored

public boolean isCaseIgnored()
Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes.

Specified by:
isCaseIgnored in interface javax.naming.directory.Attributes
Returns:
true always.

size

public int size()
Retrieves the number of attributes in the attribute set.

Specified by:
size in interface javax.naming.directory.Attributes
Returns:
The nonnegative number of attributes in this attribute set.

get

public javax.naming.directory.Attribute get(java.lang.String attrId)
Retrieves the attribute with the given attribute id from the attribute set.

Specified by:
get in interface javax.naming.directory.Attributes
Parameters:
attrId - The non-null id of the attribute to retrieve. If this attribute set ignores the character case of its attribute ids, the case of attrID is ignored.
Returns:
The attribute identified by attrID; null if not found.
See Also:
put(java.lang.String, java.lang.Object), remove(java.lang.String)

getAll

public javax.naming.NamingEnumeration getAll()
Retrieves an enumeration of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined.

Specified by:
getAll in interface javax.naming.directory.Attributes
Returns:
A non-null enumeration of the attributes in this attribute set. Each element of the enumeration is of class Attribute. If attribute set has zero attributes, an empty enumeration is returned.

getIDs

public javax.naming.NamingEnumeration getIDs()
Retrieves an enumeration of the ids of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined.

Specified by:
getIDs in interface javax.naming.directory.Attributes
Returns:
A non-null enumeration of the attributes' ids in this attribute set. Each element of the enumeration is of class String. If attribute set has zero attributes, an empty enumeration is returned.

put

public javax.naming.directory.Attribute put(java.lang.String attrId,
                                            java.lang.Object val)
Adds a new attribute to the attribute set.

Specified by:
put in interface javax.naming.directory.Attributes
Parameters:
attrId - non-null The id of the attribute to add. If the attribute set ignores the character case of its attribute ids, the case of attrID is ignored.
val - The possibly null value of the attribute to add. If null, the attribute does not have any values.
Returns:
The Attribute with attrID that was previous in this attribute set null if no such attribute existed.
See Also:
remove(java.lang.String)

put

public javax.naming.directory.Attribute put(javax.naming.directory.Attribute attr)
Adds a new attribute to the attribute set.

Specified by:
put in interface javax.naming.directory.Attributes
Parameters:
attr - The non-null attribute to add. If the attribute set ignores the character case of its attribute ids, the case of attr's identifier is ignored.
Returns:
The Attribute with the same ID as attr that was previous in this attribute set; null if no such attribute existed.
See Also:
remove(java.lang.String)

remove

public javax.naming.directory.Attribute remove(java.lang.String attrId)
Removes the attribute with the attribute id 'attrID' from the attribute set. If the attribute does not exist, ignore.

Specified by:
remove in interface javax.naming.directory.Attributes
Parameters:
attrId - The non-null id of the attribute to remove. If the attribute set ignores the character case of its attribute ids, the case of attrID is ignored.
Returns:
The Attribute with the same ID as attrID that was previous in the attribute set; null if no such attribute existed.

clone

public java.lang.Object clone()
Makes a shallow copy of the attribute set. The new set contains the same attributes as the original set.

Specified by:
clone in interface javax.naming.directory.Attributes
Returns:
A non-null copy of this attribute set.

toString

public java.lang.String toString()
Prints out the attributes as an LDIF.

See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)
Checks to see if this Attributes implemenation is equivalent to another. The comparision does not take into account the implementation or any Lockable interface properties. Case independent lookups by Attribute ID is considered to be significant.

Parameters:
obj - the Attributes object to test for equality to this
Returns:
true if the Attributes are equal false otherwise


Copyright © 2003-2006 . All Rights Reserved.