Class Attributes
public class Attributes extends ReadOnlyAttributes
{
// Constructors
public Attributes();
public Attributes(int elems);
public Attributes(ReadOnlyAttributes attrs);
public Attributes(Vector v);
// Methods
public Object put(Attribute v);
public Object put(Name name, Object value);
public void remove(Name name);
public void removeAll();
}
This class encapsulates a list of Attribute objects.
ReadOnlyAttributes
|
+--Attributes
public Attributes();
Constructs an empty Attribute collection.
public Attributes(int elems);
Constructs an empty Attrribute collection of a specified size. If you add more Attribute objects to it than the initially specified size, the collection grows automatically.
Parameter | Description |
elems
| The number of Attributes to initially reserve space for in the collection.
|
public Attributes(ReadOnlyAttributes attrs);
Constructs a collection of Attribute objects from an existing collection of read-only Attribute objects.
Parameter | Description |
attrs
| A read-only Attribute collection used to create the new Attributes object.
|
public Attributes(Vector v);
Constructs an empty collection of Attribute objects using the specified Vector.
Parameter | Description |
v
| The vector to use for the Attribute collection.
|
public Object put(Attribute v);
Adds an Attribute Name and value pair to the collection, or replaces the value for the named Attribute if it is already present in the collection.
Return Value:
Returns null if the Attribute was added to the collection, or returns the previous value of the Attribute if the value was replaced.
Parameter | Description |
v
| The Attribute to add. If the Attribute is already present in the collection, its current value is replaced with that in the value parameter.
|
public Object put(Name name, Object value);
Adds an Attribute Name and value pair the the collection, or replaces the value for the named Attribute if it is already present in the collection.
Return Value:
Returns null if the Attribute was added to the collection, or returns the previous value of the Attribute if the value was replaced.
Parameter | Description |
name
| The Name of the Attribute to add. If the Attribute is already present in the collection, its current value is replaced with that in the value parameter.
|
value
| The object to associate with the Attribute.
|
public void remove(Name name);
Removes the named Attribute from the collection.
Return Value:
No return value.
Parameter | Description |
name
| The Name of the Attribute to remove from the collection.
|
public void removeAll();
Removes all Attributes from the collection and sets the collection's size to zero.
Return Value:
No return value.