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(Name name, Object value);
  public Object put(Attribute v);
  public void remove(Name name);
  public void removeAll();
}

A class that encapsulates a list of attribute/value pairs.

ReadOnlyAttributes
  |
  +--Attributes

Constructors

Attributes

public Attributes();

Construct empty attributes collection.

Attributes

public Attributes(int elems);

Construct attributes collection with given number of empty slots. The collection will grow automatically if you add more than this number.

ParameterDescription
elemsthe number of attributes to reserve initially.

Attributes

public Attributes(ReadOnlyAttributes attrs);

Construct attributes collection by copying the passed attributes.

ParameterDescription
attrsattributes to clone

Attributes

public Attributes(Vector v);

Construct attributes collection using the vector of attributes.

ParameterDescription
vAttribute vector

Methods

put 

public Object put(Name name, Object value);

Add a new attribute/value pair, or replace the value for attribute if it already exists.

Return Value

Returns the previous value for the name attribute or null.

put 

public Object put(Attribute v);

Add a new attribute or replace the attribute if it already exists.

Return Value

Returns the previous value for the name attribute or null.

remove 

public void remove(Name name);

Removed the named attribute from the collection.

removeAll 

public void removeAll();