- java.lang.Object
- 
- java.util.AbstractCollection<E>
- 
- java.util.AbstractSet<E>
- 
- java.util.HashSet<JobStateReason>
- 
- javax.print.attribute.standard.JobStateReasons
 
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Iterable<JobStateReason>,- Collection<JobStateReason>,- Set<JobStateReason>,- Attribute,- PrintJobAttribute
 
 public final class JobStateReasons extends HashSet<JobStateReason> implements PrintJobAttribute ClassJobStateReasonsis a printing attribute class, a set of enumeration values, that provides additional information about the job's current state, i.e., information that augments the value of the job'sJobStateattribute.Instances of JobStateReasondo not appear in a Print Job's attribute set directly. Rather, aJobStateReasonsattribute appears in the Print Job's attribute set. TheJobStateReasonsattribute contains zero, one, or more than oneJobStateReasonobjects which pertain to the Print Job's status. The printer adds aJobStateReasonobject to the Print Job's JobStateReasons attribute when the corresponding condition becomes true of the Print Job, and the printer removes theJobStateReasonobject again when the corresponding condition becomes false, regardless of whether the Print Job's overallJobStatealso changed.Class JobStateReasonsinherits its implementation from classjava.util.HashSet. Unlike most printing attributes which are immutable once constructed, classJobStateReasonsis designed to be mutable; you can addJobStateReasonobjects to an existingJobStateReasonsobject and remove them again. However, like classjava.util.HashSet, classJobStateReasonsis not multiple thread safe. If aJobStateReasonsobject will be used by multiple threads, be sure to synchronize its operations (e.g., using a synchronized set view obtained from classjava.util.Collections).IPP Compatibility: The string value returned by each individual JobStateReasonobject'stoString()method gives the IPP keyword value. The category name returned bygetName()gives the IPP attribute name.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description JobStateReasons()Construct a new, empty job state reasons attribute; the underlying hash set has the default initial capacity and load factor.JobStateReasons(int initialCapacity)Construct a new, empty job state reasons attribute; the underlying hash set has the given initial capacity and the default load factor.JobStateReasons(int initialCapacity, float loadFactor)Construct a new, empty job state reasons attribute; the underlying hash set has the given initial capacity and load factor.JobStateReasons(Collection<JobStateReason> collection)Construct a new job state reasons attribute that contains the sameJobStateReasonobjects as the given collection.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(JobStateReason o)Adds the specified element to this job state reasons attribute if it is not already present.Class<? extends Attribute>getCategory()Get the printing attribute class which is to be used as the "category" for this printing attribute value.StringgetName()Get the name of the category of which this attribute value is an instance.- 
Methods declared in class java.util.HashSetclear, clone, contains, isEmpty, iterator, remove, size, spliterator
 - 
Methods declared in class java.util.AbstractSetequals, hashCode, removeAll
 - 
Methods declared in class java.util.AbstractCollectionaddAll, containsAll, retainAll, toArray, toArray, toString
 - 
Methods declared in interface java.util.CollectionparallelStream, removeIf, stream, toArray
 
- 
 
- 
- 
- 
Constructor Detail- 
JobStateReasonspublic JobStateReasons() Construct a new, empty job state reasons attribute; the underlying hash set has the default initial capacity and load factor.
 - 
JobStateReasonspublic JobStateReasons(int initialCapacity) Construct a new, empty job state reasons attribute; the underlying hash set has the given initial capacity and the default load factor.- Parameters:
- initialCapacity- initial capacity
- Throws:
- IllegalArgumentException- if the initial capacity is negative
 
 - 
JobStateReasonspublic JobStateReasons(int initialCapacity, float loadFactor)Construct a new, empty job state reasons attribute; the underlying hash set has the given initial capacity and load factor.- Parameters:
- initialCapacity- initial capacity
- loadFactor- load factor
- Throws:
- IllegalArgumentException- if the initial capacity is negative
 
 - 
JobStateReasonspublic JobStateReasons(Collection<JobStateReason> collection) Construct a new job state reasons attribute that contains the sameJobStateReasonobjects as the given collection. The underlying hash set's initial capacity and load factor are as specified in the superclass constructorHashSet(Collection).- Parameters:
- collection- collection to copy
- Throws:
- NullPointerException- if- collectionis- nullor if any element in- collectionis- null
- ClassCastException- if any element in- collectionis not an instance of class- JobStateReason
 
 
- 
 - 
Method Detail- 
addpublic boolean add(JobStateReason o) Adds the specified element to this job state reasons attribute if it is not already present. The element to be added must be an instance of classJobStateReason. If this job state reasons attribute already contains the specified element, the call leaves this job state reasons attribute unchanged and returnsfalse.- Specified by:
- addin interface- Collection<JobStateReason>
- Specified by:
- addin interface- Set<JobStateReason>
- Overrides:
- addin class- HashSet<JobStateReason>
- Parameters:
- o- element to be added to this job state reasons attribute
- Returns:
- trueif this job state reasons attribute did not already contain the specified element
- Throws:
- NullPointerException- if the specified element is- null
- ClassCastException- if the specified element is not an instance of class- JobStateReason
- Since:
- 1.5
 
 - 
getCategorypublic final Class<? extends Attribute> getCategory() Get the printing attribute class which is to be used as the "category" for this printing attribute value.For class JobStateReasons, the category is class JobStateReasons itself.- Specified by:
- getCategoryin interface- Attribute
- Returns:
- printing attribute class (category), an instance of class
         java.lang.Class
 
 
- 
 
-