KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)JobImpressions.java 1.7 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 JobImpressions is an integer valued printing attribute class that
16  * specifies the total size in number of impressions of the document(s) being
17  * submitted. An "impression" is the image (possibly many print-stream pages in
18  * different configurations) imposed onto a single media page.
19  * <P>
20  * The JobImpressions attribute describes the size of the job. This attribute is
21  * not intended to be a counter; it is intended to be useful routing and
22  * scheduling information if known. The printer may try to compute the
23  * JobImpressions attribute's value if it is not supplied in the Print Request.
24  * Even if the client does supply a value for the JobImpressions attribute in
25  * the Print Request, the printer may choose to change the value if the printer
26  * is able to compute a value which is more accurate than the client supplied
27  * value. The printer may be able to determine the correct value for the
28  * JobImpressions attribute either right at job submission time or at any later
29  * point in time.
30  * <P>
31  * As with {@link JobKOctets JobKOctets}, the JobImpressions value must not
32  * include the multiplicative factors contributed by the number of copies
33  * specified by the {@link Copies Copies} attribute, independent of whether the
34  * device can process multiple copies without making multiple passes over the
35  * job or document data and independent of whether the output is collated or
36  * not. Thus the value is independent of the implementation and reflects the
37  * size of the document(s) measured in impressions independent of the number of
38  * copies.
39  * <P>
40  * As with {@link JobKOctets JobKOctets}, the JobImpressions value must also not
41  * include the multiplicative factor due to a copies instruction embedded in the
42  * document data. If the document data actually includes replications of the
43  * document data, this value will include such replication. In other words, this
44  * value is always the number of impressions in the source document data, rather
45  * than a measure of the number of impressions to be produced by the job.
46  * <P>
47  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
48  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
49  * name.
50  * <P>
51  *
52  * @see JobImpressionsSupported
53  * @see JobImpressionsCompleted
54  * @see JobKOctets
55  * @see JobMediaSheets
56  *
57  * @author Alan Kaminsky
58  */

59 public final class JobImpressions extends IntegerSyntax JavaDoc
60     implements PrintRequestAttribute JavaDoc, PrintJobAttribute JavaDoc {
61
62     private static final long serialVersionUID = 8225537206784322464L;
63
64
65     /**
66      * Construct a new job impressions attribute with the given integer value.
67      *
68      * @param value Integer value.
69      *
70      * @exception IllegalArgumentException
71      * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
72      */

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

96     public boolean equals(Object JavaDoc object) {
97     return super.equals (object) && object instanceof JobImpressions JavaDoc;
98     }
99
100     /**
101      * Get the printing attribute class which is to be used as the "category"
102      * for this printing attribute value.
103      * <P>
104      * For class JobImpressions, the category is class JobImpressions itself.
105      *
106      * @return Printing attribute class (category), an instance of class
107      * {@link java.lang.Class java.lang.Class}.
108      */

109     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
110     return JobImpressions JavaDoc.class;
111     }
112
113     /**
114      * Get the name of the category of which this attribute value is an
115      * instance.
116      * <P>
117      * For class JobImpressions, the category name is
118      * <CODE>"job-impressions"</CODE>.
119      *
120      * @return Attribute category name.
121      */

122     public final String JavaDoc getName() {
123     return "job-impressions";
124     }
125     
126 }
127
Popular Tags