Class ReadOnlyAttributes
public class ReadOnlyAttributes
{
// Constructors
public ReadOnlyAttributes();
public ReadOnlyAttributes(Vector v);
public ReadOnlyAttributes(int elems);
// Methods
public Enumeration attributes();
public Object get(Name name);
public Attribute lookup(Name name);
public int size();
public String toString();
}
This class encapsulates a read-only list of Attribute objects.
public ReadOnlyAttributes();
Constructs an empty read-only Attribute collection.
public ReadOnlyAttributes(Vector v);
Constructs a read-only collection of Attribute objects using the given Vector of Attributes.
Parameter | Description |
v
| The Vector that contains the Attribute objects.
|
public ReadOnlyAttributes(int elems);
Constructs an empty Attribute collection of the specified size. If you add more Attribute objects to the collection than the initially specified size, it grows automatically.
Parameter | Description |
elems
| The number of Attribute objects to initially reserve space for in the collection.
|
public Enumeration attributes();
Retrieves an Enumeration of the Attribute objects in the collection.
Return Value:
Returns an Enumeration of the Attribute objects in the collection.
public Object get(Name name);
Retrieves the named Attribute object and returns its associated value.
Return Value:
Returns an object that is the associated value for the named Attribute.
Parameter | Description |
name
| A Name object that identifies the Attribute to retrieve.
|
public Attribute lookup(Name name);
Cycles through the collection of Attribute objects and retrieves the named Attribute, if it is present.
Return Value:
Returns the named Attribute; returns null if the Attribute is not currently included in the collection.
public int size();
Retrieves the number of Attribute Name and value pairs currently in the collection.
Return Value:
Returns the number of pairs in the collection.
public String toString();
Retrieves a String representation of the class name of the ReadOnlyAttributes object.
Return Value:
Returns the class name for the ReadOnlyAttributes object.