Interface PrintRequestAttributeSet specifies the interface for a set of print request attributes, i.e. printing attributes that implement interface PrintRequestAttribute . The client uses a PrintRequestAttributeSet to specify the settings to be applied to a whole print job and to all the docs in the print job.

PrintRequestAttributeSet is just an AttributeSet whose constructors and mutating operations guarantee an additional invariant, namely that all attribute values in the PrintRequestAttributeSet must be instances of interface PrintRequestAttribute . The add(Attribute) , and addAll(AttributeSet) operations are respecified below to guarantee this additional invariant.

@author
Alan Kaminsky
Adds the specified attribute to this attribute set if it is not already present, first removing any existing value in the same attribute category as the specified attribute value.
Parameters
attributeAttribute value to be added to this attribute set.
Return
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 set.
Throws
NullPointerException (unchecked exception) Thrown if the attribute is null.
UnmodifiableSetException (unchecked exception) Thrown if this attribute set does not support the add() operation.
Adds all of the elements in the specified set to this attribute. The outcome is the same as if the = add(Attribute) operation had been applied to this attribute set successively with each element from the specified set. The behavior of the addAll(AttributeSet) operation is unspecified if the specified set is modified while the operation is in progress.

If the addAll(AttributeSet) operation throws an exception, the effect on this attribute set's state is implementation dependent; elements from the specified set before the point of the exception may or may not have been added to this attribute set.

Parameters
attributeswhose elements are to be added to this attribute set.
Return
true if this attribute set changed as a result of the call.
Throws
UnmodifiableSetException (Unchecked exception) Thrown if this attribute set does not support the addAll(AttributeSet) method.
NullPointerException (Unchecked exception) Thrown if some element in the specified set is null.
Removes all attributes from this attribute set.
Throws
UnmodifiableSetException (unchecked exception) Thrown if this attribute set does not support the clear() operation.
Returns true if this attribute set contains an attribute for the specified category.
Parameters
categorywhose presence in this attribute set is to be tested.
Return
true if this attribute set contains an attribute value for the specified category.
Returns true if this attribute set contains the given attribute value.
Parameters
attributeAttribute value whose presence in this attribute set is to be tested.
Return
true if this attribute set contains the given attribute value.
Compares the specified object with this attribute set for equality. Returns true if the given object is also an attribute set and the two attribute sets contain the same attribute category-attribute value mappings. This ensures that the equals() method works properly across different implementations of the AttributeSet interface.
Parameters
objectto be compared for equality with this attribute set.
Return
true if the specified object is equal to this attribute set.
Returns the attribute value which this attribute set contains in the given attribute category. Returns null if this attribute set does not contain any attribute value in the given attribute category.
Parameters
categoryAttribute category whose associated attribute value is to be returned. It must be a {@link java.lang.Class Class} that implements interface {@link Attribute Attribute}.
Return
The attribute value in the given attribute category contained in this attribute set, or null if this attribute set does not contain any attribute value in the given attribute category.
Throws
NullPointerException (unchecked exception) Thrown if the category is null.
ClassCastException (unchecked exception) Thrown if the category is not a {@link java.lang.Class Class} that implements interface {@link Attribute Attribute}.
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 AttributeSet. This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two attribute sets t1 and t2, as required by the general contract of Object.hashCode() .
Return
The hash code value for this attribute set.
Returns true if this attribute set contains no attributes.
Return
true if this attribute set contains no attributes.
Removes the specified attribute from this attribute set if present. If attribute is null, then remove() does nothing and returns false.
Parameters
attributeAttribute value to be removed from this attribute set.
Return
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 set.
Throws
UnmodifiableSetException (unchecked exception) Thrown if this attribute set does not support the remove() operation.
Removes any attribute for this category from this attribute set if present. If category is null, then remove() does nothing and returns false.
Parameters
categoryAttribute category to be removed from this attribute set.
Return
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 set.
Throws
UnmodifiableSetException (unchecked exception) Thrown if this attribute set does not support the remove() operation.
Returns the number of attributes in this attribute set. If this attribute set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
Return
The number of attributes in this attribute set.
Returns an array of the attributes contained in this set.
Return
the Attributes contained in this set as an array, zero length if the AttributeSet is empty.