KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > JobMediaSheets


1 /*
2  * @(#)JobMediaSheets.java 1.6 04/05/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.print.attribute.standard;
8
9 import javax.print.attribute.Attribute JavaDoc;
10 import javax.print.attribute.IntegerSyntax JavaDoc;
11 import javax.print.attribute.PrintRequestAttribute JavaDoc;
12 import javax.print.attribute.PrintJobAttribute JavaDoc;
13
14 /**
15  * Class JobMediaSheets is an integer valued printing attribute class that
16  * specifies the total number of media sheets to be produced for this job.
17  * <P>
18  * The JobMediaSheets attribute describes the size of the job. This attribute is
19  * not intended to be a counter; it is intended to be useful routing and
20  * scheduling information if known. The printer may try to compute the
21  * JobMediaSheets attribute's value if it is not supplied in the Print Request.
22  * Even if the client does supply a value for the JobMediaSheets attribute in
23  * the Print Request, the printer may choose to change the value if the printer
24  * is able to compute a value which is more accurate than the client supplied
25  * value. The printer may be able to determine the correct value for the
26  * JobMediaSheets attribute either right at job submission time or at any later
27  * point in time.
28  * <P>
29  * Unlike the {@link JobKOctets JobKOctets} and {@link JobImpressions
30  * JobImpressions} attributes, the JobMediaSheets value must include the
31  * multiplicative factors contributed by the number of copies specified by the
32  * {@link Copies Copies} attribute and a "number of copies" instruction embedded
33  * in the document data, if any. This difference allows the system administrator
34  * to control the lower and upper bounds of both (1) the size of the document(s)
35  * with {@link JobKOctetsSupported JobKOctetsSupported} and {@link
36  * JobImpressionsSupported JobImpressionsSupported} and (2) the size of the job
37  * with {@link JobMediaSheetsSupported JobMediaSheetsSupported}.
38  * <P>
39  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
40  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
41  * name.
42  * <P>
43  *
44  * @see JobMediaSheetsSupported
45  * @see JobMediaSheetsCompleted
46  * @see JobKOctets
47  * @see JobImpressions
48  *
49  * @author Alan Kaminsky
50  */

51 public class JobMediaSheets extends IntegerSyntax JavaDoc
52     implements PrintRequestAttribute JavaDoc, PrintJobAttribute JavaDoc {
53
54
55     private static final long serialVersionUID = 408871131531979741L;
56
57     /**
58      * Construct a new job media sheets attribute with the given integer
59      * value.
60      *
61      * @param value Integer value.
62      *
63      * @exception IllegalArgumentException
64      * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
65      */

66     public JobMediaSheets(int value) {
67     super (value, 0, Integer.MAX_VALUE);
68     }
69
70     /**
71      * Returns whether this job media sheets attribute is equivalent to the
72      * passed in object. To be equivalent, all of the following conditions must
73      * be true:
74      * <OL TYPE=1>
75      * <LI>
76      * <CODE>object</CODE> is not null.
77      * <LI>
78      * <CODE>object</CODE> is an instance of class JobMediaSheets.
79      * <LI>
80      * This job media sheets attribute's value and <CODE>object</CODE>'s
81      * value are equal.
82      * </OL>
83      *
84      * @param object Object to compare to.
85      *
86      * @return True if <CODE>object</CODE> is equivalent to this job media
87      * sheets attribute, false otherwise.
88      */

89     public boolean equals(Object JavaDoc object) {
90     return super.equals(object) && object instanceof JobMediaSheets JavaDoc;
91     }
92
93     /**
94      * Get the printing attribute class which is to be used as the "category"
95      * for this printing attribute value.
96      * <P>
97      * For class JobMediaSheets and any vendor-defined subclasses, the category
98      * is class JobMediaSheets itself.
99      *
100      * @return Printing attribute class (category), an instance of class
101      * {@link java.lang.Class java.lang.Class}.
102      */

103     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
104     return JobMediaSheets JavaDoc.class;
105     }
106
107     /**
108      * Get the name of the category of which this attribute value is an
109      * instance.
110      * <P>
111      * For class JobMediaSheets and any vendor-defined subclasses, the
112      * category name is <CODE>"job-media-sheets"</CODE>.
113      *
114      * @return Attribute category name.
115      */

116     public final String JavaDoc getName() {
117     return "job-media-sheets";
118     }
119
120 }
121
Popular Tags