blob: 6022dc7ddc13a0dfead6da0bc57109ac2ca5d535 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25package javax.print.attribute.standard;
26
27import javax.print.attribute.Attribute;
28import javax.print.attribute.IntegerSyntax;
29import javax.print.attribute.PrintJobAttribute;
30
31/**
32 * Class JobMediaSheetsCompleted is an integer valued printing attribute class
33 * that specifies the number of media sheets which have completed marking and
34 * stacking for the entire job so far, whether those sheets have been processed
35 * on one side or on both.
36 * <P>
37 * The JobMediaSheetsCompleted attribute describes the progress of the job. This
38 * attribute is intended to be a counter. That is, the JobMediaSheetsCompleted
39 * value for a job that has not started processing must be 0. When the job's
40 * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
41 * JobMediaSheetsCompleted value is intended to increase as the job is
42 * processed; it indicates the amount of the job that has been processed at the
43 * time the Print Job's attribute set is queried or at the time a print job
44 * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
45 * states, the JobMediaSheetsCompleted value is the final value for 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 JobMediaSheets
53 * @see JobMediaSheetsSupported
54 * @see JobKOctetsProcessed
55 * @see JobImpressionsCompleted
56 *
57 * @author Alan Kaminsky
58 */
59public final class JobMediaSheetsCompleted extends IntegerSyntax
60 implements PrintJobAttribute {
61
62
63 private static final long serialVersionUID = 1739595973810840475L;
64
65 /**
66 * Construct a new job media sheets completed attribute with the given
67 * integer value.
68 *
69 * @param value Integer value.
70 *
71 * @exception IllegalArgumentException
72 * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
73 */
74 public JobMediaSheetsCompleted(int value) {
75 super (value, 0, Integer.MAX_VALUE);
76 }
77
78 /**
79 * Returns whether this job media sheets completed attribute is equivalent
80 * to the passed in object. To be equivalent, all of the following
81 * conditions must be true:
82 * <OL TYPE=1>
83 * <LI>
84 * <CODE>object</CODE> is not null.
85 * <LI>
86 * <CODE>object</CODE> is an instance of class JobMediaSheetsCompleted.
87 * <LI>
88 * This job media sheets completed attribute's value and
89 * <CODE>object</CODE>'s value are equal.
90 * </OL>
91 *
92 * @param object Object to compare to.
93 *
94 * @return True if <CODE>object</CODE> is equivalent to this job media
95 * sheets completed attribute, false otherwise.
96 */
97 public boolean equals(Object object) {
98 return (super.equals (object) &&
99 object instanceof JobMediaSheetsCompleted);
100 }
101
102 /**
103 * Get the printing attribute class which is to be used as the "category"
104 * for this printing attribute value.
105 * <P>
106 * For class JobMediaSheetsCompleted, the category is class
107 * JobMediaSheetsCompleted itself.
108 *
109 * @return Printing attribute class (category), an instance of class
110 * {@link java.lang.Class java.lang.Class}.
111 */
112 public final Class<? extends Attribute> getCategory() {
113 return JobMediaSheetsCompleted.class;
114 }
115
116 /**
117 * Get the name of the category of which this attribute value is an
118 * instance.
119 * <P>
120 * For class JobMediaSheetsCompleted, the category name is
121 * <CODE>"job-media-sheets-completed"</CODE>.
122 *
123 * @return Attribute category name.
124 */
125 public final String getName() {
126 return "job-media-sheets-completed";
127 }
128}