HashAttributeSet (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../../java.base/java/io/Serializable.html "interface in java.io"), [AttributeSet](AttributeSet.html "interface in javax.print.attribute")

Direct Known Subclasses:

[HashDocAttributeSet](HashDocAttributeSet.html "class in javax.print.attribute"), [HashPrintJobAttributeSet](HashPrintJobAttributeSet.html "class in javax.print.attribute"), [HashPrintRequestAttributeSet](HashPrintRequestAttributeSet.html "class in javax.print.attribute"), [HashPrintServiceAttributeSet](HashPrintServiceAttributeSet.html "class in javax.print.attribute")


public class HashAttributeSet extends Object implements AttributeSet, Serializable

Class HashAttributeSet provides an AttributeSet implementation with characteristics of a hash map.

See Also:

Serialized Form

Constructors

Modifier Constructor Description
HashAttributeSet() Construct a new, empty attribute set.
protected HashAttributeSet​(Class<?> interfaceName) Construct a new, empty attribute set, where the members of the attribute set are restricted to the given interface.
HashAttributeSet​(Attribute attribute) Construct a new attribute set, initially populated with the given attribute.
HashAttributeSet​(Attribute[] attributes) Construct a new attribute set, initially populated with the values from the given array.
protected HashAttributeSet​(Attribute[] attributes,Class<?> interfaceName) Construct a new attribute set, where the members of the attribute set are restricted to the given interface.
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​(AttributeSet attributes) Construct a new attribute set, initially populated with the values from the given set.
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.
Modifier and Type Method Description
boolean add​(Attribute attribute) 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.
boolean addAll​(AttributeSet attributes) Adds all of the elements in the specified set to this attribute.
void clear() Removes all attributes from this attribute set.
boolean containsKey​(Class<?> category) Returns true if this attribute set contains an attribute for the specified category.
boolean containsValue​(Attribute attribute) Returns true if this attribute set contains the given attribute.
boolean equals​(Object object) Compares the specified object with this attribute set for equality.
Attribute get​(Class<?> category) Returns the attribute value which this attribute set contains in the given attribute category.
int hashCode() Returns the hash code value for this attribute set.
boolean isEmpty() Returns true if this attribute set contains no attributes.
boolean remove​(Class<?> category) Removes any attribute for this category from this attribute set if present.
boolean remove​(Attribute attribute) Removes the specified attribute from this attribute set if present.
int size() Returns the number of attributes in this attribute set.
Attribute[] toArray() Returns an array of the attributes contained in this set.