HashAttributeSet provides an AttributeSet
implementation with characteristics of a hash map.
| Modifier and Type | Field and Description |
|---|---|
| private transient HashMap | attrMap
A |
| private Class | myInterface
The interface of which all members of this attribute set must be an instance. |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | HashAttributeSet(Attribute
attribute value to add to the set attribute)Construct a new attribute set, initially populated with the given attribute. |
| public | HashAttributeSet(Attribute[]
array of attribute values to add to the set. If
attributes)null, an empty attribute set is constructed.Construct a new attribute set, initially populated with the values from the given array. |
| public | HashAttributeSet(AttributeSet
set of attributes from which to initialise this set.
If attributes)null, an empty attribute set is constructed.Construct a new attribute set, initially populated with the values from the given set. |
| protected | HashAttributeSet(Class<?>
the interface of which all members of this
attribute set must be an instance. It is assumed to be interface
interfaceName)Attribute or a subinterface thereof.Construct a new, empty attribute set, where the members of the attribute set are restricted to the given interface. |
| protected | HashAttributeSet(Attribute
attribute value to add to the set attribute, Class<?> the interface of which all members of this
attribute set must be an instance. It is assumed to be interface
interfaceName)Attribute or a subinterface thereof.Construct a new attribute set, initially populated with the given attribute, where the members of the attribute set are restricted to the given interface. |
| protected | HashAttributeSet(Attribute[]
array of attribute values to add to the set. If
attributes, Class<?> null, an empty attribute set is constructed.the interface of which all members of this
attribute set must be an instance. It is assumed to be interface
interfaceName)Attribute or a subinterface thereof.Construct a new attribute set, where the members of the attribute set are restricted to the given interface. |
| protected | HashAttributeSet(AttributeSet
set of attribute values to initialise the set. If
attributes, Class<?> null, an empty attribute set is constructed.The interface of which all members of this
attribute set must be an instance. It is assumed to be interface
interfaceName)Attribute or a subinterface thereof.Construct a new attribute set, initially populated with the values from the given set where the members of the attribute set are restricted to the given interface. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this attribute set changed as a result of the
call, i.e., the given attribute value was not already a member of
this attribute setattribute value to be added to this attribute set attribute)Implements javax. Adds the specified attribute to this attribute set if it is not already present, first removing any existing in the same attribute category as the specified attribute value. |
| public boolean | Returns: true if this attribute set changed as a result of the
callwhose elements are to be added to this attribute set attributes)Implements javax. Adds all of the elements in the specified set to this attribute. |
| public void | clear()
Implements javax. Removes all attributes from this attribute set. |
| public boolean | Returns: true if this attribute set contains an attribute value
for the specified categorywhose presence in this attribute set is to be tested category)Implements javax. Returns |
| public boolean | Returns: true if this attribute set contains the given attribute
valuevalue whose presence in this attribute set is to be
tested attribute)Implements javax. Returns |
| public boolean | Returns: true if the specified object is equal to this attribute
setto be compared for equality with this attribute set object)Overrides java. Implements javax. Compares the specified object with this attribute set for equality. |
| public Attribute | Returns: the attribute value in the given attribute category contained in this attribute set, ornull if this attribute set does
not contain any attribute value in the given attribute categoryImplements javax. Returns the attribute value which this attribute set contains in the given attribute category. |
| public int | Returns: the hash code value for this attribute setOverrides java. Implements javax. Returns the hash code value for this attribute set. |
| public boolean | Returns: true if this attribute set contains no attributesImplements javax. Returns |
| private void | readObject(ObjectInputStream
the input stream s)Reconstitute an instance from a stream that is, deserialize it). |
| public boolean | Returns: true if this attribute set changed as a result of the
call, i.e., the given attribute category had been a member of
this attribute setattribute category to be removed from this attribute set category)Implements javax. Removes any attribute for this category from this attribute set if present. |
| public boolean | Returns: true if this attribute set changed as a result of the
call, i.e., the given attribute value had been a member of this
attribute setattribute value to be removed from this attribute set attribute)Implements javax. Removes the specified attribute from this attribute set if present. |
| public int | Returns: the number of attributes in this attribute setImplements javax. Returns the number of attributes in this attribute set. |
| public Attribute[] | Returns: the attributes contained in this set as an array, zero length if theAttributeSet is emptyImplements javax. Returns an array of the attributes contained in this set. |
| private void | writeObject(ObjectOutputStream
the output stream s)Write the instance to a stream (ie serialize the object). |
| attrMap | back to summary |
|---|---|
| private transient HashMap<Class<?>, Attribute> attrMap A | |
| myInterface | back to summary |
|---|---|
| private Class<?> myInterface The interface of which all members of this attribute set must be an
instance. It is assumed to be interface | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JDK 1.4 for interoperability. | |
| HashAttributeSet | back to summary |
|---|---|
| public HashAttributeSet() Construct a new, empty attribute set. | |
| HashAttributeSet | back to summary |
|---|---|
| public HashAttributeSet(Attribute attribute) Construct a new attribute set, initially populated with the given attribute.
| |
| HashAttributeSet | back to summary |
|---|---|
| public HashAttributeSet(Attribute[] attributes) Construct a new attribute set, initially populated with the values from
the given array. The new attribute set is populated by adding the
elements of
| |
| HashAttributeSet | back to summary |
|---|---|
| public HashAttributeSet(AttributeSet attributes) Construct a new attribute set, initially populated with the values from the given set.
| |
| HashAttributeSet | back to summary |
|---|---|
| protected HashAttributeSet(Class<?> interfaceName) Construct a new, empty attribute set, where the members of the attribute set are restricted to the given interface.
| |
| HashAttributeSet | back to summary |
|---|---|
| protected HashAttributeSet(Attribute attribute, Class<?> interfaceName) Construct a new attribute set, initially populated with the given attribute, where the members of the attribute set are restricted to the given interface.
| |
| HashAttributeSet | back to summary |
|---|---|
| protected HashAttributeSet(Attribute[] attributes, Class<?> interfaceName) Construct a new attribute set, where the members of the attribute set are
restricted to the given interface. The new attribute set is populated by
adding the elements of
| |
| HashAttributeSet | back to summary |
|---|---|
| protected HashAttributeSet(AttributeSet attributes, Class<?> interfaceName) Construct a new attribute set, initially populated with the values from the given set where the members of the attribute set are restricted to the given interface.
| |
| add | back to summary |
|---|---|
| public boolean add(Attribute attribute) Implements javax. Adds the specified attribute to this attribute set if it is not already present, first removing any existing in the same attribute category as the specified attribute value.
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(AttributeSet attributes) Implements javax. Adds all of the elements in the specified set to this attribute. The
outcome is the same as if the
If the
| |
| clear | back to summary |
|---|---|
| public void clear() Implements javax. Removes all attributes from this attribute set.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Class<?> category) Implements javax. Returns | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Attribute attribute) Implements javax. Returns | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Implements javax. Compares the specified object with this attribute set for equality.
Returns | |
| get | back to summary |
|---|---|
| public Attribute get(Class<?> category) Implements javax. Returns the attribute value which this attribute set contains in the
given attribute category. Returns
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements javax. Returns the hash code value for this attribute set. The hash code of an
attribute set is defined to be the sum of the hash codes of each entry in
the
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements javax. Returns
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException Reconstitute an instance from a stream that is, deserialize it).
| |
| remove | back to summary |
|---|---|
| public boolean remove(Class<?> category) Implements javax. Removes any attribute for this category from this attribute set if
present. If
| |
| remove | back to summary |
|---|---|
| public boolean remove(Attribute attribute) Implements javax. Removes the specified attribute from this attribute set if present. If
| |
| size | back to summary |
|---|---|
| public int size() Implements javax. Returns the number of attributes in this attribute set. If this attribute
set contains more than
| |
| toArray | back to summary |
|---|---|
| public Attribute[] toArray() Implements javax. Returns an array of the attributes contained in this set. | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Write the instance to a stream (ie serialize the object).
| |