javax.naming.directory
Class BasicAttribute

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.naming.directory.BasicAttribute
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable , Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute

public class BasicAttribute
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute

This class provides a basic implementation of the Attribute interface.

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.

Since:
1.3
See Also:
Serialized Form

Field Summary
protected  String sample code for java.lang.String definition code for java.lang.String attrID sample code for javax.naming.directory.BasicAttribute.attrID definition code for javax.naming.directory.BasicAttribute.attrID
          Holds the attribute's id.
protected  boolean ordered sample code for javax.naming.directory.BasicAttribute.ordered definition code for javax.naming.directory.BasicAttribute.ordered
          A flag for recording whether this attribute's values are ordered.
protected  Vector sample code for java.util.Vector definition code for java.util.Vector <Object sample code for java.lang.Object definition code for java.lang.Object > values sample code for javax.naming.directory.BasicAttribute.values definition code for javax.naming.directory.BasicAttribute.values
          Holds the attribute's values.
 
Constructor Summary
BasicAttribute sample code for javax.naming.directory.BasicAttribute.BasicAttribute(java.lang.String) definition code for javax.naming.directory.BasicAttribute.BasicAttribute(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  id)
          Constructs a new instance of an unordered attribute with no value.
BasicAttribute sample code for javax.naming.directory.BasicAttribute.BasicAttribute(java.lang.String, boolean) definition code for javax.naming.directory.BasicAttribute.BasicAttribute(java.lang.String, boolean) (String sample code for java.lang.String definition code for java.lang.String  id, boolean ordered)
          Constructs a new instance of a possibly ordered attribute with no value.
BasicAttribute sample code for javax.naming.directory.BasicAttribute.BasicAttribute(java.lang.String, java.lang.Object) definition code for javax.naming.directory.BasicAttribute.BasicAttribute(java.lang.String, java.lang.Object) (String sample code for java.lang.String definition code for java.lang.String  id, Object sample code for java.lang.Object definition code for java.lang.Object  value)
          Constructs a new instance of an unordered attribute with a single value.
BasicAttribute sample code for javax.naming.directory.BasicAttribute.BasicAttribute(java.lang.String, java.lang.Object, boolean) definition code for javax.naming.directory.BasicAttribute.BasicAttribute(java.lang.String, java.lang.Object, boolean) (String sample code for java.lang.String definition code for java.lang.String  id, Object sample code for java.lang.Object definition code for java.lang.Object  value, boolean ordered)
          Constructs a new instance of a possibly ordered attribute with a single value.
 
Method Summary
 void add sample code for javax.naming.directory.BasicAttribute.add(int, java.lang.Object) definition code for javax.naming.directory.BasicAttribute.add(int, java.lang.Object) (int ix, Object sample code for java.lang.Object definition code for java.lang.Object  attrVal)
          Adds an attribute value to the ordered list of attribute values.
 boolean add sample code for javax.naming.directory.BasicAttribute.add(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.add(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  attrVal)
          Adds a new value to this attribute.
 void clear sample code for javax.naming.directory.BasicAttribute.clear() definition code for javax.naming.directory.BasicAttribute.clear() ()
          Removes all values from this attribute.
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for javax.naming.directory.BasicAttribute.clone() definition code for javax.naming.directory.BasicAttribute.clone() ()
          Creates and returns a copy of this object.
 boolean contains sample code for javax.naming.directory.BasicAttribute.contains(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.contains(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  attrVal)
          Determines whether a value is in this attribute.
 boolean equals sample code for javax.naming.directory.BasicAttribute.equals(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Determines whether obj is equal to this attribute.
 Object sample code for java.lang.Object definition code for java.lang.Object get sample code for javax.naming.directory.BasicAttribute.get() definition code for javax.naming.directory.BasicAttribute.get() ()
          Retrieves one of this attribute's values.
 Object sample code for java.lang.Object definition code for java.lang.Object get sample code for javax.naming.directory.BasicAttribute.get(int) definition code for javax.naming.directory.BasicAttribute.get(int) (int ix)
          Retrieves the attribute value from the ordered list of attribute values.
 NamingEnumeration sample code for javax.naming.NamingEnumeration definition code for javax.naming.NamingEnumeration <?> getAll sample code for javax.naming.directory.BasicAttribute.getAll() definition code for javax.naming.directory.BasicAttribute.getAll() ()
          Retrieves an enumeration of this attribute's values.
 DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext getAttributeDefinition sample code for javax.naming.directory.BasicAttribute.getAttributeDefinition() definition code for javax.naming.directory.BasicAttribute.getAttributeDefinition() ()
          Retrieves this attribute's schema definition.
 DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext getAttributeSyntaxDefinition sample code for javax.naming.directory.BasicAttribute.getAttributeSyntaxDefinition() definition code for javax.naming.directory.BasicAttribute.getAttributeSyntaxDefinition() ()
          Retrieves the syntax definition associated with this attribute.
 String sample code for java.lang.String definition code for java.lang.String getID sample code for javax.naming.directory.BasicAttribute.getID() definition code for javax.naming.directory.BasicAttribute.getID() ()
          Retrieves the id of this attribute.
 int hashCode sample code for javax.naming.directory.BasicAttribute.hashCode() definition code for javax.naming.directory.BasicAttribute.hashCode() ()
          Calculates the hash code of this attribute.
 boolean isOrdered sample code for javax.naming.directory.BasicAttribute.isOrdered() definition code for javax.naming.directory.BasicAttribute.isOrdered() ()
          Determines whether this attribute's values are ordered.
 Object sample code for java.lang.Object definition code for java.lang.Object remove sample code for javax.naming.directory.BasicAttribute.remove(int) definition code for javax.naming.directory.BasicAttribute.remove(int) (int ix)
          Removes an attribute value from the ordered list of attribute values.
 boolean remove sample code for javax.naming.directory.BasicAttribute.remove(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.remove(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  attrval)
          Removes a specified value from this attribute.
 Object sample code for java.lang.Object definition code for java.lang.Object set sample code for javax.naming.directory.BasicAttribute.set(int, java.lang.Object) definition code for javax.naming.directory.BasicAttribute.set(int, java.lang.Object) (int ix, Object sample code for java.lang.Object definition code for java.lang.Object  attrVal)
          Sets an attribute value in the ordered list of attribute values.
 int size sample code for javax.naming.directory.BasicAttribute.size() definition code for javax.naming.directory.BasicAttribute.size() ()
          Retrieves the number of values in this attribute.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.naming.directory.BasicAttribute.toString() definition code for javax.naming.directory.BasicAttribute.toString() ()
          Generates the string representation of this attribute.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

attrID sample code for javax.naming.directory.BasicAttribute.attrID

protected String sample code for java.lang.String definition code for java.lang.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.


values sample code for javax.naming.directory.BasicAttribute.values

protected transient Vector sample code for java.util.Vector definition code for java.util.Vector <Object sample code for java.lang.Object definition code for java.lang.Object > values
Holds the attribute's values. Initialized by public constructors. Cannot be null unless methods in BasicAttribute that use values have been overridden.


ordered sample code for javax.naming.directory.BasicAttribute.ordered

protected boolean ordered
A flag for recording whether this attribute's values are ordered.

Constructor Detail

BasicAttribute sample code for javax.naming.directory.BasicAttribute(java.lang.String) definition code for javax.naming.directory.BasicAttribute(java.lang.String)

public BasicAttribute(String sample code for java.lang.String definition code for java.lang.String  id)
Constructs a new instance of an unordered attribute with no value.

Parameters:
id - The attribute's id. It cannot be null.

BasicAttribute sample code for javax.naming.directory.BasicAttribute(java.lang.String, java.lang.Object) definition code for javax.naming.directory.BasicAttribute(java.lang.String, java.lang.Object)

public BasicAttribute(String sample code for java.lang.String definition code for java.lang.String  id,
                      Object sample code for java.lang.Object definition code for java.lang.Object  value)
Constructs a new instance of an unordered attribute with a single value.

Parameters:
id - The attribute's id. It cannot be null.
value - The attribute's value. If null, a null value is added to the attribute.

BasicAttribute sample code for javax.naming.directory.BasicAttribute(java.lang.String, boolean) definition code for javax.naming.directory.BasicAttribute(java.lang.String, boolean)

public BasicAttribute(String sample code for java.lang.String definition code for java.lang.String  id,
                      boolean ordered)
Constructs a new instance of a possibly ordered attribute with no value.

Parameters:
id - The attribute's id. It cannot be null.
ordered - true means the attribute's values will be ordered; false otherwise.

BasicAttribute sample code for javax.naming.directory.BasicAttribute(java.lang.String, java.lang.Object, boolean) definition code for javax.naming.directory.BasicAttribute(java.lang.String, java.lang.Object, boolean)

public BasicAttribute(String sample code for java.lang.String definition code for java.lang.String  id,
                      Object sample code for java.lang.Object definition code for java.lang.Object  value,
                      boolean ordered)
Constructs a new instance of a possibly ordered attribute with a single value.

Parameters:
id - The attribute's id. It cannot be null.
value - The attribute's value. If null, a null value is added to the attribute.
ordered - true means the attribute's values will be ordered; false otherwise.
Method Detail

clone sample code for javax.naming.directory.BasicAttribute.clone() definition code for javax.naming.directory.BasicAttribute.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Description copied from class: Object sample code for java.lang.Object.clone() definition code for java.lang.Object.clone()
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:
 x.clone() != x
will be true, and that the expression:
 x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
 x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

The method clone for class Object performs a specific cloning operation. First, if the class of this object does not implement the interface Cloneable, then a CloneNotSupportedException is thrown. Note that all arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation.

The class Object does not itself implement the interface Cloneable, so calling the clone method on an object whose class is Object will result in throwing an exception at run time.

Specified by:
clone sample code for javax.naming.directory.Attribute.clone() definition code for javax.naming.directory.Attribute.clone() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a clone of this instance.
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

equals sample code for javax.naming.directory.BasicAttribute.equals(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Determines whether obj is equal to this attribute. Two attributes are equal if their attribute-ids, syntaxes and values are equal. If the attribute values are unordered, the order that the values were added are irrelevant. If the attribute values are ordered, then the order the values must match. If obj is null or not an Attribute, false is returned.

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.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - The possibly null object to check.
Returns:
true if obj is equal to this attribute; false otherwise.
See Also:
hashCode() sample code for javax.naming.directory.BasicAttribute.hashCode() definition code for javax.naming.directory.BasicAttribute.hashCode() , contains(java.lang.Object) sample code for javax.naming.directory.BasicAttribute.contains(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.contains(java.lang.Object)

hashCode sample code for javax.naming.directory.BasicAttribute.hashCode() definition code for javax.naming.directory.BasicAttribute.hashCode()

public int hashCode()
Calculates the hash code of this attribute.

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.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
an int representing the hash code of this attribute.
See Also:
equals(java.lang.Object) sample code for javax.naming.directory.BasicAttribute.equals(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.equals(java.lang.Object)

toString sample code for javax.naming.directory.BasicAttribute.toString() definition code for javax.naming.directory.BasicAttribute.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Generates the string representation of this attribute. The string consists of the attribute's id and its values. This string is meant for debugging and not meant to be interpreted programmatically.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
The non-null string representation of this attribute.

getAll sample code for javax.naming.directory.BasicAttribute.getAll() definition code for javax.naming.directory.BasicAttribute.getAll()

public NamingEnumeration sample code for javax.naming.NamingEnumeration definition code for javax.naming.NamingEnumeration <?> getAll()
                            throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Retrieves an enumeration of this attribute's values.

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.

Specified by:
getAll sample code for javax.naming.directory.Attribute.getAll() definition code for javax.naming.directory.Attribute.getAll() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Returns:
A non-null enumeration of the attribute's values. Each element of the enumeration is a possibly null Object. The object's class is the class of the attribute value. The element is null if the attribute's value is null. If the attribute has zero values, an empty enumeration is returned.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If a naming exception was encountered while retrieving the values.
See Also:
Attribute.isOrdered() sample code for javax.naming.directory.Attribute.isOrdered() definition code for javax.naming.directory.Attribute.isOrdered()

get sample code for javax.naming.directory.BasicAttribute.get() definition code for javax.naming.directory.BasicAttribute.get()

public Object sample code for java.lang.Object definition code for java.lang.Object  get()
           throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Retrieves one of this attribute's values.

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.

Specified by:
get sample code for javax.naming.directory.Attribute.get() definition code for javax.naming.directory.Attribute.get() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Returns:
A possibly null object representing one of the attribute's value. It is null if the attribute's value is null.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If a naming exception was encountered while retrieving the value.

size sample code for javax.naming.directory.BasicAttribute.size() definition code for javax.naming.directory.BasicAttribute.size()

public int size()
Description copied from interface: Attribute sample code for javax.naming.directory.Attribute.size() definition code for javax.naming.directory.Attribute.size()
Retrieves the number of values in this attribute.

Specified by:
size sample code for javax.naming.directory.Attribute.size() definition code for javax.naming.directory.Attribute.size() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Returns:
The nonnegative number of values in this attribute.

getID sample code for javax.naming.directory.BasicAttribute.getID() definition code for javax.naming.directory.BasicAttribute.getID()

public String sample code for java.lang.String definition code for java.lang.String  getID()
Description copied from interface: Attribute sample code for javax.naming.directory.Attribute.getID() definition code for javax.naming.directory.Attribute.getID()
Retrieves the id of this attribute.

Specified by:
getID sample code for javax.naming.directory.Attribute.getID() definition code for javax.naming.directory.Attribute.getID() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Returns:
The id of this attribute. It cannot be null.

contains sample code for javax.naming.directory.BasicAttribute.contains(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.contains(java.lang.Object)

public boolean contains(Object sample code for java.lang.Object definition code for java.lang.Object  attrVal)
Determines whether a value is in this attribute.

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.

Specified by:
contains sample code for javax.naming.directory.Attribute.contains(java.lang.Object) definition code for javax.naming.directory.Attribute.contains(java.lang.Object) in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Parameters:
attrVal - The possibly null value to check. If null, check whether the attribute has an attribute value whose value is null.
Returns:
true if attrVal is one of this attribute's values; false otherwise.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , equals(java.lang.Object) sample code for javax.naming.directory.BasicAttribute.equals(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.equals(java.lang.Object)

add sample code for javax.naming.directory.BasicAttribute.add(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.add(java.lang.Object)

public boolean add(Object sample code for java.lang.Object definition code for java.lang.Object  attrVal)
Adds a new value to this attribute.

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.

Specified by:
add sample code for javax.naming.directory.Attribute.add(java.lang.Object) definition code for javax.naming.directory.Attribute.add(java.lang.Object) in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Parameters:
attrVal - The new possibly null value to add. If null, null is added as an attribute value.
Returns:
true if a value was added; false otherwise.

remove sample code for javax.naming.directory.BasicAttribute.remove(java.lang.Object) definition code for javax.naming.directory.BasicAttribute.remove(java.lang.Object)

public boolean remove(Object sample code for java.lang.Object definition code for java.lang.Object  attrval)
Removes a specified value from this attribute.

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.

Specified by:
remove sample code for javax.naming.directory.Attribute.remove(java.lang.Object) definition code for javax.naming.directory.Attribute.remove(java.lang.Object) in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Parameters:
attrval - The possibly null value to remove from this attribute. If null, remove the attribute value that is null.
Returns:
true if the value was removed; false otherwise.

clear sample code for javax.naming.directory.BasicAttribute.clear() definition code for javax.naming.directory.BasicAttribute.clear()

public void clear()
Description copied from interface: Attribute sample code for javax.naming.directory.Attribute.clear() definition code for javax.naming.directory.Attribute.clear()
Removes all values from this attribute.

Specified by:
clear sample code for javax.naming.directory.Attribute.clear() definition code for javax.naming.directory.Attribute.clear() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute

isOrdered sample code for javax.naming.directory.BasicAttribute.isOrdered() definition code for javax.naming.directory.BasicAttribute.isOrdered()

public boolean isOrdered()
Description copied from interface: Attribute sample code for javax.naming.directory.Attribute.isOrdered() definition code for javax.naming.directory.Attribute.isOrdered()
Determines whether this attribute's values are ordered. If an attribute's values are ordered, duplicate values are allowed. If an attribute's values are unordered, they are presented in any order and there are no duplicate values.

Specified by:
isOrdered sample code for javax.naming.directory.Attribute.isOrdered() definition code for javax.naming.directory.Attribute.isOrdered() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Returns:
true if this attribute's values are ordered; false otherwise.
See Also:
Attribute.get(int) sample code for javax.naming.directory.Attribute.get(int) definition code for javax.naming.directory.Attribute.get(int) , Attribute.remove(int) sample code for javax.naming.directory.Attribute.remove(int) definition code for javax.naming.directory.Attribute.remove(int) , Attribute.add(int, java.lang.Object) sample code for javax.naming.directory.Attribute.add(int, java.lang.Object) definition code for javax.naming.directory.Attribute.add(int, java.lang.Object) , Attribute.set(int, java.lang.Object) sample code for javax.naming.directory.Attribute.set(int, java.lang.Object) definition code for javax.naming.directory.Attribute.set(int, java.lang.Object)

get sample code for javax.naming.directory.BasicAttribute.get(int) definition code for javax.naming.directory.BasicAttribute.get(int)

public Object sample code for java.lang.Object definition code for java.lang.Object  get(int ix)
           throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Description copied from interface: Attribute sample code for javax.naming.directory.Attribute.get(int) definition code for javax.naming.directory.Attribute.get(int)
Retrieves the attribute value from the ordered list of attribute values. This method returns the value at the ix index of the list of attribute values. If the attribute values are unordered, this method returns the value that happens to be at that index.

Specified by:
get sample code for javax.naming.directory.Attribute.get(int) definition code for javax.naming.directory.Attribute.get(int) in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Parameters:
ix - The index of the value in the ordered list of attribute values. 0 <= ix < size().
Returns:
The possibly null attribute value at index ix; null if the attribute value is null.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If a naming exception was encountered while retrieving the value.

remove sample code for javax.naming.directory.BasicAttribute.remove(int) definition code for javax.naming.directory.BasicAttribute.remove(int)

public Object sample code for java.lang.Object definition code for java.lang.Object  remove(int ix)
Description copied from interface: Attribute sample code for javax.naming.directory.Attribute.remove(int) definition code for javax.naming.directory.Attribute.remove(int)
Removes an attribute value from the ordered list of attribute values. This method removes the value at the ix index of the list of attribute values. If the attribute values are unordered, this method removes the value that happens to be at that index. Values located at indices greater than ix are shifted up towards the front of the list (and their indices decremented by one).

Specified by:
remove sample code for javax.naming.directory.Attribute.remove(int) definition code for javax.naming.directory.Attribute.remove(int) in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Parameters:
ix - The index of the value to remove. 0 <= ix < size().
Returns:
The possibly null attribute value at index ix that was removed; null if the attribute value is null.

add sample code for javax.naming.directory.BasicAttribute.add(int, java.lang.Object) definition code for javax.naming.directory.BasicAttribute.add(int, java.lang.Object)

public void add(int ix,
                Object sample code for java.lang.Object definition code for java.lang.Object  attrVal)
Description copied from interface: Attribute sample code for javax.naming.directory.Attribute.add(int, java.lang.Object) definition code for javax.naming.directory.Attribute.add(int, java.lang.Object)
Adds an attribute value to the ordered list of attribute values. This method adds attrVal to the list of attribute values at index ix. Values located at indices at or greater than ix are shifted down towards the end of the list (and their indices incremented by one). If the attribute values are unordered and already have attrVal, IllegalStateException is thrown.

Specified by:
add sample code for javax.naming.directory.Attribute.add(int, java.lang.Object) definition code for javax.naming.directory.Attribute.add(int, java.lang.Object) in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Parameters:
ix - The index in the ordered list of attribute values to add the new value. 0 <= ix <= size().
attrVal - The possibly null attribute value to add; if null, null is the value added.

set sample code for javax.naming.directory.BasicAttribute.set(int, java.lang.Object) definition code for javax.naming.directory.BasicAttribute.set(int, java.lang.Object)

public Object sample code for java.lang.Object definition code for java.lang.Object  set(int ix,
                  Object sample code for java.lang.Object definition code for java.lang.Object  attrVal)
Description copied from interface: Attribute sample code for javax.naming.directory.Attribute.set(int, java.lang.Object) definition code for javax.naming.directory.Attribute.set(int, java.lang.Object)
Sets an attribute value in the ordered list of attribute values. This method sets the value at the ix index of the list of attribute values to be attrVal. The old value is removed. If the attribute values are unordered, this method sets the value that happens to be at that index to attrVal, unless attrVal is already one of the values. In that case, IllegalStateException is thrown.

Specified by:
set sample code for javax.naming.directory.Attribute.set(int, java.lang.Object) definition code for javax.naming.directory.Attribute.set(int, java.lang.Object) in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Parameters:
ix - The index of the value in the ordered list of attribute values. 0 <= ix < size().
attrVal - The possibly null attribute value to use. If null, 'null' replaces the old value.
Returns:
The possibly null attribute value at index ix that was replaced. Null if the attribute value was null.

getAttributeSyntaxDefinition sample code for javax.naming.directory.BasicAttribute.getAttributeSyntaxDefinition() definition code for javax.naming.directory.BasicAttribute.getAttributeSyntaxDefinition()

public DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext  getAttributeSyntaxDefinition()
                                        throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Retrieves the syntax definition associated with this attribute.

This method by default throws OperationNotSupportedException. A subclass should override this method if it supports schema.

Specified by:
getAttributeSyntaxDefinition sample code for javax.naming.directory.Attribute.getAttributeSyntaxDefinition() definition code for javax.naming.directory.Attribute.getAttributeSyntaxDefinition() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Returns:
The attribute's syntax definition. Null if the implementation supports schemas but this particular attribute does not have any schema information.
Throws:
OperationNotSupportedException sample code for javax.naming.OperationNotSupportedException definition code for javax.naming.OperationNotSupportedException - If getting the schema is not supported.
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If a naming exception occurs while getting the schema.

getAttributeDefinition sample code for javax.naming.directory.BasicAttribute.getAttributeDefinition() definition code for javax.naming.directory.BasicAttribute.getAttributeDefinition()

public DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext  getAttributeDefinition()
                                  throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Retrieves this attribute's schema definition.

This method by default throws OperationNotSupportedException. A subclass should override this method if it supports schema.

Specified by:
getAttributeDefinition sample code for javax.naming.directory.Attribute.getAttributeDefinition() definition code for javax.naming.directory.Attribute.getAttributeDefinition() in interface Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute
Returns:
This attribute's schema definition. Null if the implementation supports schemas but this particular attribute does not have any schema information.
Throws:
OperationNotSupportedException sample code for javax.naming.OperationNotSupportedException definition code for javax.naming.OperationNotSupportedException - If getting the schema is not supported.
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If a naming exception occurs while getting the schema.