45 * SINGLE_DOCUMENT -- The result will be <I>n</I> copies of a single output 46 * document comprising all the input docs. 47 * 48 * <LI> 49 * SINGLE_DOCUMENT_NEW_SHEET -- The result will be <I>n</I> copies of a single 50 * output document comprising all the input docs, and the first impression of 51 * each input doc will always start on a new media sheet. 52 * 53 * <LI> 54 * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The result will be <I>n</I> copies of 55 * the first input document, followed by <I>n</I> copies of the second input 56 * document, . . . followed by <I>n</I> copies of the last input document. 57 * 58 * <LI> 59 * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The result will be the first input 60 * document, the second input document, . . . the last input document, the group 61 * of documents being repeated <I>n</I> times. 62 * </UL> 63 * <P> 64 * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The 65 * category name returned by <CODE>getName()</CODE> gives the IPP attribute 66 * name. 67 * 68 * @author David Mendenhall 69 * @author Alan Kamihensky 70 */ 71 public final class Copies extends IntegerSyntax 72 implements PrintRequestAttribute, PrintJobAttribute { 73 74 private static final long serialVersionUID = -6426631521680023833L; 75 76 /** 77 * Construct a new copies attribute with the given integer value. 78 * 79 * @param value Integer value. 80 * 81 * @exception IllegalArgumentException 82 * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1. 83 */ 84 public Copies(int value) { 85 super (value, 1, Integer.MAX_VALUE); 86 } 87 88 /** 89 * Returns whether this copies attribute is equivalent to the passed in 90 * object. To be equivalent, all of the following conditions must be true: 91 * <OL TYPE=1> 92 * <LI> 93 * <CODE>object</CODE> is not null. 94 * <LI> 95 * <CODE>object</CODE> is an instance of class Copies. 96 * <LI> 97 * This copies attribute's value and <CODE>object</CODE>'s value are 98 * equal. 99 * </OL> 100 * 101 * @param object Object to compare to. 102 * 103 * @return True if <CODE>object</CODE> is equivalent to this copies 104 * attribute, false otherwise. 105 */ 106 public boolean equals(Object object) { 107 return super.equals (object) && object instanceof Copies; 108 } 109 110 /** 111 * Get the printing attribute class which is to be used as the "category" 112 * for this printing attribute value. 113 * <P> 114 * For class Copies, the category is class Copies itself. 115 * 116 * @return Printing attribute class (category), an instance of class 117 * {@link java.lang.Class java.lang.Class}. 118 */ 119 public final Class<? extends Attribute> getCategory() { 120 return Copies.class; 121 } 122 123 /** 124 * Get the name of the category of which this attribute value is an 125 * instance. 126 * <P> 127 * For class Copies, the category name is <CODE>"copies"</CODE>. 128 * 129 * @return Attribute category name. 130 */ 131 public final String getName() { 132 return "copies"; 133 } 134 135 } | 45 * SINGLE_DOCUMENT -- The result will be <I>n</I> copies of a single output 46 * document comprising all the input docs. 47 * 48 * <LI> 49 * SINGLE_DOCUMENT_NEW_SHEET -- The result will be <I>n</I> copies of a single 50 * output document comprising all the input docs, and the first impression of 51 * each input doc will always start on a new media sheet. 52 * 53 * <LI> 54 * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The result will be <I>n</I> copies of 55 * the first input document, followed by <I>n</I> copies of the second input 56 * document, . . . followed by <I>n</I> copies of the last input document. 57 * 58 * <LI> 59 * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The result will be the first input 60 * document, the second input document, . . . the last input document, the group 61 * of documents being repeated <I>n</I> times. 62 * </UL> 63 * <P> 64 * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The 65 * category name returned by {@code getName()} gives the IPP attribute 66 * name. 67 * 68 * @author David Mendenhall 69 * @author Alan Kamihensky 70 */ 71 public final class Copies extends IntegerSyntax 72 implements PrintRequestAttribute, PrintJobAttribute { 73 74 private static final long serialVersionUID = -6426631521680023833L; 75 76 /** 77 * Construct a new copies attribute with the given integer value. 78 * 79 * @param value Integer value. 80 * 81 * @exception IllegalArgumentException 82 * (Unchecked exception) Thrown if {@code value} is less than 1. 83 */ 84 public Copies(int value) { 85 super (value, 1, Integer.MAX_VALUE); 86 } 87 88 /** 89 * Returns whether this copies attribute is equivalent to the passed in 90 * object. To be equivalent, all of the following conditions must be true: 91 * <OL TYPE=1> 92 * <LI> 93 * {@code object} is not null. 94 * <LI> 95 * {@code object} is an instance of class Copies. 96 * <LI> 97 * This copies attribute's value and {@code object}'s value are 98 * equal. 99 * </OL> 100 * 101 * @param object Object to compare to. 102 * 103 * @return True if {@code object} is equivalent to this copies 104 * attribute, false otherwise. 105 */ 106 public boolean equals(Object object) { 107 return super.equals (object) && object instanceof Copies; 108 } 109 110 /** 111 * Get the printing attribute class which is to be used as the "category" 112 * for this printing attribute value. 113 * <P> 114 * For class Copies, the category is class Copies itself. 115 * 116 * @return Printing attribute class (category), an instance of class 117 * {@link java.lang.Class java.lang.Class}. 118 */ 119 public final Class<? extends Attribute> getCategory() { 120 return Copies.class; 121 } 122 123 /** 124 * Get the name of the category of which this attribute value is an 125 * instance. 126 * <P> 127 * For class Copies, the category name is {@code "copies"}. 128 * 129 * @return Attribute category name. 130 */ 131 public final String getName() { 132 return "copies"; 133 } 134 135 } |