javax.print.attribute
Class AttributeSetUtilities

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.print.attribute.AttributeSetUtilities

public final class AttributeSetUtilities
extends Object sample code for java.lang.Object definition code for java.lang.Object

Class AttributeSetUtilities provides static methods for manipulating AttributeSets.

An unmodifiable view U of an AttributeSet S provides a client with "read-only" access to S. Query operations on U "read through" to S; thus, changes in S are reflected in U. However, any attempt to modify U, results in an UnmodifiableSetException. The unmodifiable view object U will be serializable if the attribute set object S is serializable.

A synchronized view V of an attribute set S provides a client with synchronized (multiple thread safe) access to S. Each operation of V is synchronized using V itself as the lock object and then merely invokes the corresponding operation of S. In order to guarantee mutually exclusive access, it is critical that all access to S is accomplished through V. The synchronized view object V will be serializable if the attribute set object S is serializable.

As mentioned in the package description of javax.print, a null reference parameter to methods is incorrect unless explicitly documented on the method as having a meaningful interpretation. Usage to the contrary is incorrect coding and may result in a run time exception either immediately or at some later time. IllegalArgumentException and NullPointerException are examples of typical and acceptable run time exceptions for such cases.


Method Summary
static AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.AttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.AttributeSet) (AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributeSet)
          Creates a synchronized view of the given attribute set.
static DocAttributeSet sample code for javax.print.attribute.DocAttributeSet definition code for javax.print.attribute.DocAttributeSet synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.DocAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.DocAttributeSet) (DocAttributeSet sample code for javax.print.attribute.DocAttributeSet definition code for javax.print.attribute.DocAttributeSet  attributeSet)
          Creates a synchronized view of the given doc attribute set.
static PrintJobAttributeSet sample code for javax.print.attribute.PrintJobAttributeSet definition code for javax.print.attribute.PrintJobAttributeSet synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintJobAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintJobAttributeSet) (PrintJobAttributeSet sample code for javax.print.attribute.PrintJobAttributeSet definition code for javax.print.attribute.PrintJobAttributeSet  attributeSet)
          Creates a synchronized view of the given print job attribute set.
static PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintRequestAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintRequestAttributeSet) (PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet  attributeSet)
          Creates a synchronized view of the given print request attribute set.
static PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintServiceAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintServiceAttributeSet) (PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet  attributeSet)
          Creates a synchronized view of the given print service attribute set.
static AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.AttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.AttributeSet) (AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributeSet)
          Creates an unmodifiable view of the given attribute set.
static DocAttributeSet sample code for javax.print.attribute.DocAttributeSet definition code for javax.print.attribute.DocAttributeSet unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.DocAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.DocAttributeSet) (DocAttributeSet sample code for javax.print.attribute.DocAttributeSet definition code for javax.print.attribute.DocAttributeSet  attributeSet)
          Creates an unmodifiable view of the given doc attribute set.
static PrintJobAttributeSet sample code for javax.print.attribute.PrintJobAttributeSet definition code for javax.print.attribute.PrintJobAttributeSet unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintJobAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintJobAttributeSet) (PrintJobAttributeSet sample code for javax.print.attribute.PrintJobAttributeSet definition code for javax.print.attribute.PrintJobAttributeSet  attributeSet)
          Creates an unmodifiable view of the given print job attribute set.
static PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintRequestAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintRequestAttributeSet) (PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet  attributeSet)
          Creates an unmodifiable view of the given print request attribute set.
static PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintServiceAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintServiceAttributeSet) (PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet  attributeSet)
          Creates an unmodifiable view of the given print service attribute set.
static Class sample code for java.lang.Class definition code for java.lang.Class <?> verifyAttributeCategory sample code for javax.print.attribute.AttributeSetUtilities.verifyAttributeCategory(java.lang.Object, java.lang.Class) definition code for javax.print.attribute.AttributeSetUtilities.verifyAttributeCategory(java.lang.Object, java.lang.Class) (Object sample code for java.lang.Object definition code for java.lang.Object  object, Class sample code for java.lang.Class definition code for java.lang.Class <?> interfaceName)
          Verify that the given object is a Class sample code for java.lang.Class definition code for java.lang.Class that implements the given interface, which is assumed to be interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute or a subinterface thereof.
static Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute verifyAttributeValue sample code for javax.print.attribute.AttributeSetUtilities.verifyAttributeValue(java.lang.Object, java.lang.Class) definition code for javax.print.attribute.AttributeSetUtilities.verifyAttributeValue(java.lang.Object, java.lang.Class) (Object sample code for java.lang.Object definition code for java.lang.Object  object, Class sample code for java.lang.Class definition code for java.lang.Class <?> interfaceName)
          Verify that the given object is an instance of the given interface, which is assumed to be interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute or a subinterface thereof.
static void verifyCategoryForValue sample code for javax.print.attribute.AttributeSetUtilities.verifyCategoryForValue(java.lang.Class, javax.print.attribute.Attribute) definition code for javax.print.attribute.AttributeSetUtilities.verifyCategoryForValue(java.lang.Class, javax.print.attribute.Attribute) (Class sample code for java.lang.Class definition code for java.lang.Class <?> category, Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute  attribute)
          Verify that the given attribute category object is equal to the category of the given attribute value object.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Method Detail

unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.AttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.AttributeSet)

public static AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  unmodifiableView(AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributeSet)
Creates an unmodifiable view of the given attribute set.

Parameters:
attributeSet - Underlying attribute set.
Returns:
Unmodifiable view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null. Null is never a

unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.DocAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.DocAttributeSet)

public static DocAttributeSet sample code for javax.print.attribute.DocAttributeSet definition code for javax.print.attribute.DocAttributeSet  unmodifiableView(DocAttributeSet sample code for javax.print.attribute.DocAttributeSet definition code for javax.print.attribute.DocAttributeSet  attributeSet)
Creates an unmodifiable view of the given doc attribute set.

Parameters:
attributeSet - Underlying doc attribute set.
Returns:
Unmodifiable view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null.

unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintRequestAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintRequestAttributeSet)

public static PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet  unmodifiableView(PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet  attributeSet)
Creates an unmodifiable view of the given print request attribute set.

Parameters:
attributeSet - Underlying print request attribute set.
Returns:
Unmodifiable view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null.

unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintJobAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintJobAttributeSet)

public static PrintJobAttributeSet sample code for javax.print.attribute.PrintJobAttributeSet definition code for javax.print.attribute.PrintJobAttributeSet  unmodifiableView(PrintJobAttributeSet sample code for javax.print.attribute.PrintJobAttributeSet definition code for javax.print.attribute.PrintJobAttributeSet  attributeSet)
Creates an unmodifiable view of the given print job attribute set.

Parameters:
attributeSet - Underlying print job attribute set.
Returns:
Unmodifiable view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null.

unmodifiableView sample code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintServiceAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.unmodifiableView(javax.print.attribute.PrintServiceAttributeSet)

public static PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet  unmodifiableView(PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet  attributeSet)
Creates an unmodifiable view of the given print service attribute set.

Parameters:
attributeSet - Underlying print service attribute set.
Returns:
Unmodifiable view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null.

synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.AttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.AttributeSet)

public static AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  synchronizedView(AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributeSet)
Creates a synchronized view of the given attribute set.

Parameters:
attributeSet - Underlying attribute set.
Returns:
Synchronized view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null.

synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.DocAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.DocAttributeSet)

public static DocAttributeSet sample code for javax.print.attribute.DocAttributeSet definition code for javax.print.attribute.DocAttributeSet  synchronizedView(DocAttributeSet sample code for javax.print.attribute.DocAttributeSet definition code for javax.print.attribute.DocAttributeSet  attributeSet)
Creates a synchronized view of the given doc attribute set.

Parameters:
attributeSet - Underlying doc attribute set.
Returns:
Synchronized view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null.

synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintRequestAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintRequestAttributeSet)

public static PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet  synchronizedView(PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet  attributeSet)
Creates a synchronized view of the given print request attribute set.

Parameters:
attributeSet - Underlying print request attribute set.
Returns:
Synchronized view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null.

synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintJobAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintJobAttributeSet)

public static PrintJobAttributeSet sample code for javax.print.attribute.PrintJobAttributeSet definition code for javax.print.attribute.PrintJobAttributeSet  synchronizedView(PrintJobAttributeSet sample code for javax.print.attribute.PrintJobAttributeSet definition code for javax.print.attribute.PrintJobAttributeSet  attributeSet)
Creates a synchronized view of the given print job attribute set.

Parameters:
attributeSet - Underlying print job attribute set.
Returns:
Synchronized view of attributeSet.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - Thrown if attributeSet is null.

synchronizedView sample code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintServiceAttributeSet) definition code for javax.print.attribute.AttributeSetUtilities.synchronizedView(javax.print.attribute.PrintServiceAttributeSet)

public static PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet  synchronizedView(PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet  attributeSet)
Creates a synchronized view of the given print service attribute set.

Parameters:
attributeSet - Underlying print service attribute set.
Returns:
Synchronized view of attributeSet.

verifyAttributeCategory sample code for javax.print.attribute.AttributeSetUtilities.verifyAttributeCategory(java.lang.Object, java.lang.Class<?>) definition code for javax.print.attribute.AttributeSetUtilities.verifyAttributeCategory(java.lang.Object, java.lang.Class<?>)

public static Class sample code for java.lang.Class definition code for java.lang.Class <?> verifyAttributeCategory(Object sample code for java.lang.Object definition code for java.lang.Object  object,
                                               Class sample code for java.lang.Class definition code for java.lang.Class <?> interfaceName)
Verify that the given object is a Class sample code for java.lang.Class definition code for java.lang.Class that implements the given interface, which is assumed to be interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute or a subinterface thereof.

Parameters:
object - Object to test.
interfaceName - Interface the object must implement.
Returns:
If object is a Class sample code for java.lang.Class definition code for java.lang.Class that implements interfaceName, object is returned downcast to type Class sample code for java.lang.Class definition code for java.lang.Class ; otherwise an exception is thrown.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if object is null.
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - (unchecked exception) Thrown if object is not a Class sample code for java.lang.Class definition code for java.lang.Class that implements interfaceName.

verifyAttributeValue sample code for javax.print.attribute.AttributeSetUtilities.verifyAttributeValue(java.lang.Object, java.lang.Class<?>) definition code for javax.print.attribute.AttributeSetUtilities.verifyAttributeValue(java.lang.Object, java.lang.Class<?>)

public static Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute  verifyAttributeValue(Object sample code for java.lang.Object definition code for java.lang.Object  object,
                                             Class sample code for java.lang.Class definition code for java.lang.Class <?> interfaceName)
Verify that the given object is an instance of the given interface, which is assumed to be interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute or a subinterface thereof.

Parameters:
object - Object to test.
interfaceName - Interface of which the object must be an instance.
Returns:
If object is an instance of interfaceName, object is returned downcast to type Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute ; otherwise an exception is thrown.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if object is null.
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - (unchecked exception) Thrown if object is not an instance of interfaceName.

verifyCategoryForValue sample code for javax.print.attribute.AttributeSetUtilities.verifyCategoryForValue(java.lang.Class<?>, javax.print.attribute.Attribute) definition code for javax.print.attribute.AttributeSetUtilities.verifyCategoryForValue(java.lang.Class<?>, javax.print.attribute.Attribute)

public static void verifyCategoryForValue(Class sample code for java.lang.Class definition code for java.lang.Class <?> category,
                                          Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute  attribute)
Verify that the given attribute category object is equal to the category of the given attribute value object. If so, this method returns doing nothing. If not, this method throws an exception.

Parameters:
category - Attribute category to test.
attribute - Attribute value to test.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if the category is null or if the attribute is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - (unchecked exception) Thrown if the category is not equal to the category of the attribute.