Libraries anvil naming Attribute

class Attribute
extends anvil.lang.object
This class represents an attribute associated with a named object.

Constructor
Attribute(string id, values..)
Attribute(string id, boolean ordered, values..)


Methods

Attribute add(object value)
Adds a new value to the attribute
Attribute add(int index, object value)
Adds an attribute value to the ordered list of attribute values
Parameters index -  The index in the ordered list of attribute values to add the new value. 0 <= ix <= size().
Returns this

Attribute clear()
Removes all values from this attribute.
Returns this

boolean contains(object value)
Determines whether a value is in the attribute.
Returns true if value is one of this attribute's values; false otherwise.

object get()
Retrieves one of this attribute's values.
object get(int index)
Retrieves the attribute value from the ordered list of attribute value
Parameters index -  The index of the value in the ordered list of attribute values. 0 <= index < size().

iterator getAll()
Retrieves an iterator of the attribute's values.

NamingContext getAttributeDefinition()
Retrieves the attribute's schema definition. An attribute's schema definition contains information such as whether the attribute is multivalued or single-valued, the matching rules to use when comparing the attribiute's values. The information that you can retrieve from an attribute definition is directory-dependent.

NamingContext getAttributeSyntaxDefinition()
Retrieves the syntax definition associated with the attribute. An attribute's syntax definition specifies the format of the attribute's value(s).

string getID()
Retrieves the id of this attribute.

boolean isOrdered()
Determines whether this attribute's values are ordered.

object remove(int index)
Removes an attribute value from the ordered list of attribute values.
object remove(object element)
Removes a specified value from the attribute.
Parameters index -  Index to remove
element -  Element to remove
Returns Removed element, if any

object set(int index, object element)
Sets an attribute value in the ordered list of attribute values.
Parameters index -  The index of the value in the ordered list of attribute values. 0 <= index < size().
element -  Element to set
Returns Replaced element, if any

int size()
Retrieves the number of values in this attribute.


Operators

Returns true if this attribute has values.

Returns the number of values in this attribute.

Retrieves the value at given index.

Deletes the value at given index.

Checks if given value is contained in this attribute.

Returns iterator of values in this attribute.