< prev index next >
src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java
Print this page
*** 204,217 ****
/**
* Creates an unmodifiable view of the given attribute set.
*
* @param attributeSet Underlying attribute set.
*
! * @return Unmodifiable view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null. Null is never a
*/
public static AttributeSet unmodifiableView(AttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
}
--- 204,217 ----
/**
* Creates an unmodifiable view of the given attribute set.
*
* @param attributeSet Underlying attribute set.
*
! * @return Unmodifiable view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null. Null is never a
*/
public static AttributeSet unmodifiableView(AttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
}
*** 222,235 ****
/**
* Creates an unmodifiable view of the given doc attribute set.
*
* @param attributeSet Underlying doc attribute set.
*
! * @return Unmodifiable view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null.
*/
public static DocAttributeSet unmodifiableView
(DocAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 222,235 ----
/**
* Creates an unmodifiable view of the given doc attribute set.
*
* @param attributeSet Underlying doc attribute set.
*
! * @return Unmodifiable view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null.
*/
public static DocAttributeSet unmodifiableView
(DocAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 240,253 ****
/**
* Creates an unmodifiable view of the given print request attribute set.
*
* @param attributeSet Underlying print request attribute set.
*
! * @return Unmodifiable view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null.
*/
public static PrintRequestAttributeSet
unmodifiableView(PrintRequestAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 240,253 ----
/**
* Creates an unmodifiable view of the given print request attribute set.
*
* @param attributeSet Underlying print request attribute set.
*
! * @return Unmodifiable view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null.
*/
public static PrintRequestAttributeSet
unmodifiableView(PrintRequestAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 258,271 ****
/**
* Creates an unmodifiable view of the given print job attribute set.
*
* @param attributeSet Underlying print job attribute set.
*
! * @return Unmodifiable view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null.
*/
public static PrintJobAttributeSet
unmodifiableView(PrintJobAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 258,271 ----
/**
* Creates an unmodifiable view of the given print job attribute set.
*
* @param attributeSet Underlying print job attribute set.
*
! * @return Unmodifiable view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null.
*/
public static PrintJobAttributeSet
unmodifiableView(PrintJobAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 276,289 ****
/**
* Creates an unmodifiable view of the given print service attribute set.
*
* @param attributeSet Underlying print service attribute set.
*
! * @return Unmodifiable view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null.
*/
public static PrintServiceAttributeSet
unmodifiableView(PrintServiceAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 276,289 ----
/**
* Creates an unmodifiable view of the given print service attribute set.
*
* @param attributeSet Underlying print service attribute set.
*
! * @return Unmodifiable view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null.
*/
public static PrintServiceAttributeSet
unmodifiableView(PrintServiceAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 415,428 ****
/**
* Creates a synchronized view of the given attribute set.
*
* @param attributeSet Underlying attribute set.
*
! * @return Synchronized view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null.
*/
public static AttributeSet synchronizedView
(AttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 415,428 ----
/**
* Creates a synchronized view of the given attribute set.
*
* @param attributeSet Underlying attribute set.
*
! * @return Synchronized view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null.
*/
public static AttributeSet synchronizedView
(AttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 433,446 ****
/**
* Creates a synchronized view of the given doc attribute set.
*
* @param attributeSet Underlying doc attribute set.
*
! * @return Synchronized view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null.
*/
public static DocAttributeSet
synchronizedView(DocAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 433,446 ----
/**
* Creates a synchronized view of the given doc attribute set.
*
* @param attributeSet Underlying doc attribute set.
*
! * @return Synchronized view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null.
*/
public static DocAttributeSet
synchronizedView(DocAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 451,464 ****
/**
* Creates a synchronized view of the given print request attribute set.
*
* @param attributeSet Underlying print request attribute set.
*
! * @return Synchronized view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null.
*/
public static PrintRequestAttributeSet
synchronizedView(PrintRequestAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 451,464 ----
/**
* Creates a synchronized view of the given print request attribute set.
*
* @param attributeSet Underlying print request attribute set.
*
! * @return Synchronized view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null.
*/
public static PrintRequestAttributeSet
synchronizedView(PrintRequestAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 469,482 ****
/**
* Creates a synchronized view of the given print job attribute set.
*
* @param attributeSet Underlying print job attribute set.
*
! * @return Synchronized view of <CODE>attributeSet</CODE>.
*
* @exception NullPointerException
! * Thrown if <CODE>attributeSet</CODE> is null.
*/
public static PrintJobAttributeSet
synchronizedView(PrintJobAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 469,482 ----
/**
* Creates a synchronized view of the given print job attribute set.
*
* @param attributeSet Underlying print job attribute set.
*
! * @return Synchronized view of {@code attributeSet}.
*
* @exception NullPointerException
! * Thrown if {@code attributeSet} is null.
*/
public static PrintJobAttributeSet
synchronizedView(PrintJobAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 487,497 ****
/**
* Creates a synchronized view of the given print service attribute set.
*
* @param attributeSet Underlying print service attribute set.
*
! * @return Synchronized view of <CODE>attributeSet</CODE>.
*/
public static PrintServiceAttributeSet
synchronizedView(PrintServiceAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
--- 487,497 ----
/**
* Creates a synchronized view of the given print service attribute set.
*
* @param attributeSet Underlying print service attribute set.
*
! * @return Synchronized view of {@code attributeSet}.
*/
public static PrintServiceAttributeSet
synchronizedView(PrintServiceAttributeSet attributeSet) {
if (attributeSet == null) {
throw new NullPointerException();
*** 506,526 ****
* Attribute Attribute} or a subinterface thereof.
*
* @param object Object to test.
* @param interfaceName Interface the object must implement.
*
! * @return If <CODE>object</CODE> is a {@link java.lang.Class Class}
! * that implements <CODE>interfaceName</CODE>,
! * <CODE>object</CODE> is returned downcast to type {@link
* java.lang.Class Class}; otherwise an exception is thrown.
*
* @exception NullPointerException
! * (unchecked exception) Thrown if <CODE>object</CODE> is null.
* @exception ClassCastException
! * (unchecked exception) Thrown if <CODE>object</CODE> is not a
* {@link java.lang.Class Class} that implements
! * <CODE>interfaceName</CODE>.
*/
public static Class<?>
verifyAttributeCategory(Object object, Class<?> interfaceName) {
Class<?> result = (Class<?>) object;
--- 506,526 ----
* Attribute Attribute} or a subinterface thereof.
*
* @param object Object to test.
* @param interfaceName Interface the object must implement.
*
! * @return If {@code object} is a {@link java.lang.Class Class}
! * that implements {@code interfaceName},
! * {@code object} is returned downcast to type {@link
* java.lang.Class Class}; otherwise an exception is thrown.
*
* @exception NullPointerException
! * (unchecked exception) Thrown if {@code object} is null.
* @exception ClassCastException
! * (unchecked exception) Thrown if {@code object} is not a
* {@link java.lang.Class Class} that implements
! * {@code interfaceName}.
*/
public static Class<?>
verifyAttributeCategory(Object object, Class<?> interfaceName) {
Class<?> result = (Class<?>) object;
*** 538,557 ****
* thereof.
*
* @param object Object to test.
* @param interfaceName Interface of which the object must be an instance.
*
! * @return If <CODE>object</CODE> is an instance of
! * <CODE>interfaceName</CODE>, <CODE>object</CODE> is returned
* downcast to type {@link Attribute Attribute}; otherwise an
* exception is thrown.
*
* @exception NullPointerException
! * (unchecked exception) Thrown if <CODE>object</CODE> is null.
* @exception ClassCastException
! * (unchecked exception) Thrown if <CODE>object</CODE> is not an
! * instance of <CODE>interfaceName</CODE>.
*/
public static Attribute
verifyAttributeValue(Object object, Class<?> interfaceName) {
if (object == null) {
--- 538,557 ----
* thereof.
*
* @param object Object to test.
* @param interfaceName Interface of which the object must be an instance.
*
! * @return If {@code object} is an instance of
! * {@code interfaceName}, {@code object} is returned
* downcast to type {@link Attribute Attribute}; otherwise an
* exception is thrown.
*
* @exception NullPointerException
! * (unchecked exception) Thrown if {@code object} is null.
* @exception ClassCastException
! * (unchecked exception) Thrown if {@code object} is not an
! * instance of {@code interfaceName}.
*/
public static Attribute
verifyAttributeValue(Object object, Class<?> interfaceName) {
if (object == null) {
*** 571,585 ****
*
* @param category Attribute category to test.
* @param attribute Attribute value to test.
*
* @exception NullPointerException
! * (unchecked exception) Thrown if the <CODE>category</CODE> is
! * null or if the <CODE>attribute</CODE> is null.
* @exception IllegalArgumentException
! * (unchecked exception) Thrown if the <CODE>category</CODE> is not
! * equal to the category of the <CODE>attribute</CODE>.
*/
public static void
verifyCategoryForValue(Class<?> category, Attribute attribute) {
if (!category.equals (attribute.getCategory())) {
--- 571,585 ----
*
* @param category Attribute category to test.
* @param attribute Attribute value to test.
*
* @exception NullPointerException
! * (unchecked exception) Thrown if the {@code category} is
! * null or if the {@code attribute} is null.
* @exception IllegalArgumentException
! * (unchecked exception) Thrown if the {@code category} is not
! * equal to the category of the {@code attribute}.
*/
public static void
verifyCategoryForValue(Class<?> category, Attribute attribute) {
if (!category.equals (attribute.getCategory())) {
< prev index next >