Class Overview
Class JobStateReasons is 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's JobState
attribute.
Instances of JobStateReason
do not appear in a Print
Job's attribute set directly. Rather, a JobStateReasons attribute appears in
the Print Job's attribute set. The JobStateReasons attribute contains zero,
one, or more than one JobStateReason
objects which
pertain to the Print Job's status. The printer adds a JobStateReason
object to the Print Job's JobStateReasons attribute when the
corresponding condition becomes true of the Print Job, and the printer
removes the JobStateReason
object again when the
corresponding condition becomes false, regardless of whether the Print Job's
overall JobState
also changed.
Class JobStateReasons inherits its implementation from class java.util.HashSet
. Unlike most printing attributes which
are immutable once constructed, class JobStateReasons is designed to be
mutable; you can add JobStateReason
objects to an
existing JobStateReasons object and remove them again. However, like class
java.util.HashSet
, class JobStateReasons is not
multiple thread safe. If a JobStateReasons object will be used by multiple
threads, be sure to synchronize its operations (e.g., using a synchronized
set view obtained from class java.util.Collections
).
IPP Compatibility: The string value returned by each individual JobStateReason
object's toString()
method gives
the IPP keyword value. The category name returned by getName()
gives the IPP attribute name.
Summary
Public Constructors |
|
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 same
JobStateReason objects as the given collection.
|
Public Methods |
boolean
|
add(JobStateReason o)
Adds the specified element to this job state reasons attribute if it is
not already present.
|
final
Class<? extends Attribute>
|
getCategory()
Get the printing attribute class which is to be used as the "category"
for this printing attribute value.
|
final
String
|
getName()
Get the name of the category of which this attribute value is an
instance.
|
[Expand]
Inherited Methods |
From class
java.util.HashSet
boolean
|
add(E e)
Adds the specified element to this set if it is not already present.
|
void
|
clear()
Removes all of the elements from this set.
|
Object
|
clone()
Returns a shallow copy of this HashSet instance: the elements
themselves are not cloned.
|
boolean
|
contains(Object o)
Returns true if this set contains the specified element.
|
boolean
|
isEmpty()
Returns true if this set contains no elements.
|
Iterator<E>
|
iterator()
Returns an iterator over the elements in this set.
|
boolean
|
remove(Object o)
Removes the specified element from this set if it is present.
|
int
|
size()
Returns the number of elements in this set (its cardinality).
|
|
From class
java.util.AbstractSet
boolean
|
equals(Object o)
Compares the specified object with this set for equality.
|
int
|
hashCode()
Returns the hash code value for this set.
|
boolean
|
removeAll(Collection<?> c)
Removes from this set all of its elements that are contained in the
specified collection (optional operation).
|
|
From class
java.util.AbstractCollection
boolean
|
add(E e)
Ensures that this collection contains the specified element (optional
operation).
This implementation always throws an
UnsupportedOperationException.
|
boolean
|
addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this collection
(optional operation).
This implementation iterates over the specified collection, and adds
each object returned by the iterator to this collection, in turn.
|
void
|
clear()
Removes all of the elements from this collection (optional operation).
This implementation iterates over this collection, removing each
element using the Iterator.remove operation.
|
boolean
|
contains(Object o)
Returns true if this collection contains the specified element.
This implementation iterates over the elements in the collection,
checking each element in turn for equality with the specified element.
|
boolean
|
containsAll(Collection<?> c)
Returns true if this collection contains all of the elements
in the specified collection.
This implementation iterates over the specified collection,
checking each element returned by the iterator in turn to see
if it's contained in this collection.
|
boolean
|
isEmpty()
Returns true if this collection contains no elements.
This implementation returns size() == 0.
|
abstract
Iterator<E>
|
iterator()
Returns an iterator over the elements contained in this collection.
|
boolean
|
remove(Object o)
Removes a single instance of the specified element from this
collection, if it is present (optional operation).
This implementation iterates over the collection looking for the
specified element.
|
boolean
|
removeAll(Collection<?> c)
Removes all of this collection's elements that are also contained in the
specified collection (optional operation).
This implementation iterates over this collection, checking each
element returned by the iterator in turn to see if it's contained
in the specified collection.
|
boolean
|
retainAll(Collection<?> c)
Retains only the elements in this collection that are contained in the
specified collection (optional operation).
This implementation iterates over this collection, checking each
element returned by the iterator in turn to see if it's contained
in the specified collection.
|
abstract
int
|
size()
Returns the number of elements in this collection.
|
<T>
T[]
|
toArray(T[] a)
Returns an array containing all of the elements in this collection;
the runtime type of the returned array is that of the specified array.
This implementation returns an array containing all the elements
returned by this collection's iterator in the same order, stored in
consecutive elements of the array, starting with index 0 .
|
Object[]
|
toArray()
Returns an array containing all of the elements in this collection.
This implementation returns an array containing all the elements
returned by this collection's iterator, in the same order, stored in
consecutive elements of the array, starting with index 0 .
|
String
|
toString()
Returns a string representation of this collection.
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.lang.Iterable
abstract
Iterator<T>
|
iterator()
Returns an iterator over a set of elements of type T.
|
|
From interface
java.util.Collection
abstract
boolean
|
add(E e)
Ensures that this collection contains the specified element (optional
operation).
|
abstract
boolean
|
addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this collection
(optional operation).
|
abstract
void
|
clear()
Removes all of the elements from this collection (optional operation).
|
abstract
boolean
|
contains(Object o)
Returns true if this collection contains the specified element.
|
abstract
boolean
|
containsAll(Collection<?> c)
Returns true if this collection contains all of the elements
in the specified collection.
|
abstract
boolean
|
equals(Object o)
Compares the specified object with this collection for equality.
|
abstract
int
|
hashCode()
Returns the hash code value for this collection.
|
abstract
boolean
|
isEmpty()
Returns true if this collection contains no elements.
|
abstract
Iterator<E>
|
iterator()
Returns an iterator over the elements in this collection.
|
abstract
boolean
|
remove(Object o)
Removes a single instance of the specified element from this
collection, if it is present (optional operation).
|
abstract
boolean
|
removeAll(Collection<?> c)
Removes all of this collection's elements that are also contained in the
specified collection (optional operation).
|
abstract
boolean
|
retainAll(Collection<?> c)
Retains only the elements in this collection that are contained in the
specified collection (optional operation).
|
abstract
int
|
size()
Returns the number of elements in this collection.
|
abstract
<T>
T[]
|
toArray(T[] a)
Returns an array containing all of the elements in this collection;
the runtime type of the returned array is that of the specified array.
|
abstract
Object[]
|
toArray()
Returns an array containing all of the elements in this collection.
|
|
From interface
java.util.Set
abstract
boolean
|
add(E e)
Adds the specified element to this set if it is not already present
(optional operation).
|
abstract
boolean
|
addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this set if
they're not already present (optional operation).
|
abstract
void
|
clear()
Removes all of the elements from this set (optional operation).
|
abstract
boolean
|
contains(Object o)
Returns true if this set contains the specified element.
|
abstract
boolean
|
containsAll(Collection<?> c)
Returns true if this set contains all of the elements of the
specified collection.
|
abstract
boolean
|
equals(Object o)
Compares the specified object with this set for equality.
|
abstract
int
|
hashCode()
Returns the hash code value for this set.
|
abstract
boolean
|
isEmpty()
Returns true if this set contains no elements.
|
abstract
Iterator<E>
|
iterator()
Returns an iterator over the elements in this set.
|
abstract
boolean
|
remove(Object o)
Removes the specified element from this set if it is present
(optional operation).
|
abstract
boolean
|
removeAll(Collection<?> c)
Removes from this set all of its elements that are contained in the
specified collection (optional operation).
|
abstract
boolean
|
retainAll(Collection<?> c)
Retains only the elements in this set that are contained in the
specified collection (optional operation).
|
abstract
int
|
size()
Returns the number of elements in this set (its cardinality).
|
abstract
<T>
T[]
|
toArray(T[] a)
Returns an array containing all of the elements in this set; the
runtime type of the returned array is that of the specified array.
|
abstract
Object[]
|
toArray()
Returns an array containing all of the elements in this set.
|
|
From interface
javax.print.attribute.Attribute
abstract
Class<? extends Attribute>
|
getCategory()
Get the printing attribute class which is to be used as the "category"
for this printing attribute value when it is added to an attribute set.
|
abstract
String
|
getName()
Get the name of the category of which this attribute value is an
instance.
|
|
Public Constructors
public
JobStateReasons
()
Construct a new, empty job state reasons attribute; the underlying hash
set has the default initial capacity and load factor.
public
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. |
public
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. |
Construct a new job state reasons attribute that contains the same
JobStateReason
objects as the given collection.
The underlying hash set's initial capacity and load factor are as
specified in the superclass constructor HashSet(Collection)
.
Parameters
collection
| Collection to copy. |
Public Methods
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 class
JobStateReason
. If this job state reasons
attribute already contains the specified element, the call leaves this
job state reasons attribute unchanged and returns false.
Parameters
o
| Element to be added to this job state reasons attribute. |
Returns
- true if this job state reasons attribute did not
already contain the specified element.
public
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.
public
final
String
getName
()
Get the name of the category of which this attribute value is an
instance.
For class JobStateReasons, the category
name is "job-state-reasons"
.