All LDAP Classes
Internal LDAP Classes

org.ietf.ldap
Class LDAPAttributeSet

java.lang.Object
  extended byorg.ietf.ldap.LDAPAttributeSet
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.Set

public class LDAPAttributeSet
extends java.lang.Object
implements java.lang.Cloneable, java.util.Set

An LDAPAttributeSet is a collection of LDAPAttribute classes as returned from an LDAPEntry on a search or read operation. LDAPAttributeSet may be also used to contruct an entry to be added to a directory.

See Also:
com.novell.ldap.LDAPAttributeSet

Nested Class Summary
private static class LDAPAttributeSet.WrappedIterator
          An iterator that creates org.ietf.ldap.LDAPAttribute instances from an iterator of com.novell.ldap.LDAPAttribute instances.
 
Field Summary
private  LDAPAttributeSet attrSet
           
 
Constructor Summary
  LDAPAttributeSet()
          Constructs an empty set of attributes.
(package private) LDAPAttributeSet(LDAPAttributeSet attrSet)
          Constructs a new set of attributes, using an existing attribute set.
 
Method Summary
 boolean add(java.lang.Object attr)
          Adds the specified attribute to this attribute set.
 boolean addAll(java.util.Collection attrs)
          Adds all the specified attributes to this attribute set.
 void clear()
          Removes all the attributes from this attribute set.
 java.lang.Object clone()
          Returns a deep copy of this attribute set.
 boolean contains(java.lang.Object attr)
          Returns true if this AttributeSet contains the specified Attribute.
 boolean containsAll(java.util.Collection attrs)
          Returns true if this Attribute set contains all the attributes in the specified collection.
 boolean equals(java.lang.Object set)
          Compares the specified object with this set for equality.
 LDAPAttribute getAttribute(java.lang.String attrName)
          Returns the attribute matching the specified attrName.
 LDAPAttribute getAttribute(java.lang.String attrName, java.lang.String lang)
          Returns a single best-match attribute, or null if no match is available in the entry.
 LDAPAttributeSet getSubset(java.lang.String subtype)
          Creates a new attribute set containing only the attributes that have the specified subtypes.
(package private)  LDAPAttributeSet getWrappedObject()
          Gets the com.novell.ldap.LDAPAttributeSet object.
 int hashCode()
          Returns the hash code value for this set.
 boolean isEmpty()
          Returns true if there are no elements in this set.
 java.util.Iterator iterator()
          Returns an iterator over the elements of this set.
 boolean remove(java.lang.Object obj)
          Removes the specified LDAPAttribute object from the set.
 boolean removeAll(java.util.Collection attrs)
          Returns from this set all the elements that are contained in the specified collection.
 boolean retainAll(java.util.Collection attrs)
          Retains only the elements that are contained in the specified collection.
 int size()
          Returns the number of attributes in this set.
 java.lang.Object[] toArray()
          Returns an array containing all the elements in this set.
 java.lang.Object[] toArray(java.lang.Object[] a)
          Returns an array containing all the elements in this set.
private  java.util.Collection unwrapCollection(java.util.Collection attrs)
          Unwraps the specified collection, returning a collection containing com.novell.ldap.LDAPAttribute classes.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attrSet

private LDAPAttributeSet attrSet
Constructor Detail

LDAPAttributeSet

LDAPAttributeSet(LDAPAttributeSet attrSet)
Constructs a new set of attributes, using an existing attribute set.


LDAPAttributeSet

public LDAPAttributeSet()
Constructs an empty set of attributes.

See Also:
com.novell.ldap.LDAPAttributeSet.LDAPAttributeSet()
Method Detail

getWrappedObject

LDAPAttributeSet getWrappedObject()
Gets the com.novell.ldap.LDAPAttributeSet object.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a deep copy of this attribute set.

Throws:
java.lang.CloneNotSupportedException
See Also:
com.novell.ldap.LDAPAttributeSet.clone()

getAttribute

public LDAPAttribute getAttribute(java.lang.String attrName)
Returns the attribute matching the specified attrName.

See Also:
com.novell.ldap.LDAPAttributeSet.getAttribute(String)

getAttribute

public LDAPAttribute getAttribute(java.lang.String attrName,
                                  java.lang.String lang)
Returns a single best-match attribute, or null if no match is available in the entry.

See Also:
com.novell.ldap.LDAPAttributeSet.getAttribute(String, String)

getSubset

public LDAPAttributeSet getSubset(java.lang.String subtype)
Creates a new attribute set containing only the attributes that have the specified subtypes.

See Also:
com.novell.ldap.LDAPAttributeSet.getSubset(String)

add

public boolean add(java.lang.Object attr)
Adds the specified attribute to this attribute set.

Specified by:
add in interface java.util.Set
See Also:
com.novell.ldap.LDAPAttributeSet.add(Object)

unwrapCollection

private java.util.Collection unwrapCollection(java.util.Collection attrs)
Unwraps the specified collection, returning a collection containing com.novell.ldap.LDAPAttribute classes.


addAll

public boolean addAll(java.util.Collection attrs)
Adds all the specified attributes to this attribute set.

Specified by:
addAll in interface java.util.Set
See Also:
com.novell.ldap.LDAPAttributeSet.addAll(Collection)

clear

public void clear()
Removes all the attributes from this attribute set.

Specified by:
clear in interface java.util.Set
See Also:
com.novell.ldap.LDAPAttributeSet.clear()

contains

public boolean contains(java.lang.Object attr)
Returns true if this AttributeSet contains the specified Attribute.

Specified by:
contains in interface java.util.Set
See Also:
com.novell.ldap.LDAPAttributeSet.contains(Object)

containsAll

public boolean containsAll(java.util.Collection attrs)
Returns true if this Attribute set contains all the attributes in the specified collection.

Specified by:
containsAll in interface java.util.Set

equals

public boolean equals(java.lang.Object set)
Compares the specified object with this set for equality.

Specified by:
equals in interface java.util.Set

hashCode

public int hashCode()
Returns the hash code value for this set.

Specified by:
hashCode in interface java.util.Set

isEmpty

public boolean isEmpty()
Returns true if there are no elements in this set.

Specified by:
isEmpty in interface java.util.Set
See Also:
com.novell.ldap.LDAPAttributeSet.isEmpty()

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements of this set.

Specified by:
iterator in interface java.util.Set
See Also:
com.novell.ldap.LDAPAttributeSet.iterator()

remove

public boolean remove(java.lang.Object obj)
Removes the specified LDAPAttribute object from the set.

Specified by:
remove in interface java.util.Set
See Also:
com.novell.ldap.LDAPAttributeSet.remove(Object)

removeAll

public boolean removeAll(java.util.Collection attrs)
Returns from this set all the elements that are contained in the specified collection.

Specified by:
removeAll in interface java.util.Set

retainAll

public boolean retainAll(java.util.Collection attrs)
Retains only the elements that are contained in the specified collection.

Specified by:
retainAll in interface java.util.Set

size

public int size()
Returns the number of attributes in this set.

Specified by:
size in interface java.util.Set
See Also:
com.novell.ldap.LDAPAttributeSet.size()

toArray

public java.lang.Object[] toArray()
Returns an array containing all the elements in this set.

Specified by:
toArray in interface java.util.Set

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Returns an array containing all the elements in this set.

The runtime type of the returned array is that of the specified

array.

Specified by:
toArray in interface java.util.Set

All LDAP Classes
Internal LDAP Classes

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000