Package com.ms.xml.util
 In this topic

*Constructors

*Methods

 

Packages
  PreviousThis PackageNext
Package com.ms.xml.util   Previous This
Package
Next

 


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

Constructors

Attributes

public Attributes();

Constructs an empty Attribute collection.

Attributes

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.

ParameterDescription
elems The number of Attributes to initially reserve space for in the collection.

Attributes

public Attributes(ReadOnlyAttributes attrs);

Constructs a collection of Attribute objects from an existing collection of read-only Attribute objects.

ParameterDescription
attrs A read-only Attribute collection used to create the new Attributes object.

Attributes

public Attributes(Vector v);

Constructs an empty collection of Attribute objects using the specified Vector.

ParameterDescription
v The vector to use for the Attribute collection.

Methods

put

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.

ParameterDescription
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.

put

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.

ParameterDescription
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.

remove

public void remove(Name name);

Removes the named Attribute from the collection.

Return Value:

No return value.

ParameterDescription
name The Name of the Attribute to remove from the collection.

removeAll

public void removeAll();

Removes all Attributes from the collection and sets the collection's size to zero.

Return Value:

No return value.

upnrm.gif