< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java

Print this page




 101  * on it.
 102  *
 103  * <LI>
 104  * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
 105  * For input doc <I>i,</I> each media impression will consist of
 106  * <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
 107  * docs are separate, the first impression of each input doc will always start
 108  * on a new media sheet; this means the last impression of an input doc may have
 109  * fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
 110  *
 111  * <LI>
 112  * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
 113  * For input doc <I>i,</I> each media impression will consist of
 114  * <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
 115  * docs are separate, the first impression of each input doc will always start
 116  * on a new media sheet; this means the last impression of an input doc may
 117  * have fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
 118  * </UL>
 119  * </UL>
 120  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
 121  * The category name returned by <CODE>getName()</CODE> gives the IPP
 122  * attribute name.
 123  *
 124  * @author  Alan Kaminsky
 125  */
 126 public final class NumberUp extends IntegerSyntax
 127     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
 128 
 129     private static final long serialVersionUID = -3040436486786527811L;
 130 
 131 
 132     /**
 133      * Construct a new number up attribute with the given integer value.
 134      *
 135      * @param  value  Integer value.
 136      *
 137      * @exception  IllegalArgumentException
 138      *   (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1.
 139      */
 140     public NumberUp(int value) {
 141         super (value, 1, Integer.MAX_VALUE);
 142     }
 143 
 144     /**
 145      * Returns whether this number up attribute is equivalent to the passed in
 146      * object. To be equivalent, all of the following conditions must be true:
 147      * <OL TYPE=1>
 148      * <LI>
 149      * <CODE>object</CODE> is not null.
 150      * <LI>
 151      * <CODE>object</CODE> is an instance of class NumberUp.
 152      * <LI>
 153      * This number up attribute's value and <CODE>object</CODE>'s value are
 154      * equal.
 155      * </OL>
 156      *
 157      * @param  object  Object to compare to.
 158      *
 159      * @return  True if <CODE>object</CODE> is equivalent to this number up
 160      *          attribute, false otherwise.
 161      */
 162     public boolean equals(Object object) {
 163         return (super.equals(object) && object instanceof NumberUp);
 164     }
 165 
 166     /**
 167      * Get the printing attribute class which is to be used as the "category"
 168      * for this printing attribute value.
 169      * <P>
 170      * For class NumberUp, the category is class NumberUp itself.
 171      *
 172      * @return  Printing attribute class (category), an instance of class
 173      *          {@link java.lang.Class java.lang.Class}.
 174      */
 175     public final Class<? extends Attribute> getCategory() {
 176         return NumberUp.class;
 177     }
 178 
 179     /**
 180      * Get the name of the category of which this attribute value is an
 181      * instance.
 182      * <P>
 183      * For class NumberUp, the category name is <CODE>"number-up"</CODE>.
 184      *
 185      * @return  Attribute category name.
 186      */
 187     public final String getName() {
 188         return "number-up";
 189     }
 190 
 191 }


 101  * on it.
 102  *
 103  * <LI>
 104  * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
 105  * For input doc <I>i,</I> each media impression will consist of
 106  * <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
 107  * docs are separate, the first impression of each input doc will always start
 108  * on a new media sheet; this means the last impression of an input doc may have
 109  * fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
 110  *
 111  * <LI>
 112  * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
 113  * For input doc <I>i,</I> each media impression will consist of
 114  * <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
 115  * docs are separate, the first impression of each input doc will always start
 116  * on a new media sheet; this means the last impression of an input doc may
 117  * have fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
 118  * </UL>
 119  * </UL>
 120  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
 121  * The category name returned by {@code getName()} gives the IPP
 122  * attribute name.
 123  *
 124  * @author  Alan Kaminsky
 125  */
 126 public final class NumberUp extends IntegerSyntax
 127     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
 128 
 129     private static final long serialVersionUID = -3040436486786527811L;
 130 
 131 
 132     /**
 133      * Construct a new number up attribute with the given integer value.
 134      *
 135      * @param  value  Integer value.
 136      *
 137      * @exception  IllegalArgumentException
 138      *   (Unchecked exception) Thrown if {@code value} is less than 1.
 139      */
 140     public NumberUp(int value) {
 141         super (value, 1, Integer.MAX_VALUE);
 142     }
 143 
 144     /**
 145      * Returns whether this number up attribute is equivalent to the passed in
 146      * object. To be equivalent, all of the following conditions must be true:
 147      * <OL TYPE=1>
 148      * <LI>
 149      * {@code object} is not null.
 150      * <LI>
 151      * {@code object} is an instance of class NumberUp.
 152      * <LI>
 153      * This number up attribute's value and {@code object}'s value are
 154      * equal.
 155      * </OL>
 156      *
 157      * @param  object  Object to compare to.
 158      *
 159      * @return  True if {@code object} is equivalent to this number up
 160      *          attribute, false otherwise.
 161      */
 162     public boolean equals(Object object) {
 163         return (super.equals(object) && object instanceof NumberUp);
 164     }
 165 
 166     /**
 167      * Get the printing attribute class which is to be used as the "category"
 168      * for this printing attribute value.
 169      * <P>
 170      * For class NumberUp, the category is class NumberUp itself.
 171      *
 172      * @return  Printing attribute class (category), an instance of class
 173      *          {@link java.lang.Class java.lang.Class}.
 174      */
 175     public final Class<? extends Attribute> getCategory() {
 176         return NumberUp.class;
 177     }
 178 
 179     /**
 180      * Get the name of the category of which this attribute value is an
 181      * instance.
 182      * <P>
 183      * For class NumberUp, the category name is {@code "number-up"}.
 184      *
 185      * @return  Attribute category name.
 186      */
 187     public final String getName() {
 188         return "number-up";
 189     }
 190 
 191 }
< prev index next >