Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java
38918 views
/*1* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package javax.print.attribute.standard;2526import javax.print.attribute.Attribute;27import javax.print.attribute.IntegerSyntax;28import javax.print.attribute.PrintJobAttribute;2930/**31* Class JobImpressionsCompleted is an integer valued printing attribute class32* that specifies the number of impressions completed for the job so far. For33* printing devices, the impressions completed includes interpreting, marking,34* and stacking the output.35* <P>36* The JobImpressionsCompleted attribute describes the progress of the job. This37* attribute is intended to be a counter. That is, the JobImpressionsCompleted38* value for a job that has not started processing must be 0. When the job's39* {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the40* JobImpressionsCompleted value is intended to increase as the job is41* processed; it indicates the amount of the job that has been processed at the42* time the Print Job's attribute set is queried or at the time a print job43* event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED44* states, the JobImpressionsCompleted value is the final value for the job.45* <P>46* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The47* category name returned by <CODE>getName()</CODE> gives the IPP attribute48* name.49* <P>50*51* @see JobImpressions52* @see JobImpressionsSupported53* @see JobKOctetsProcessed54* @see JobMediaSheetsCompleted55*56* @author Alan Kaminsky57*/58public final class JobImpressionsCompleted extends IntegerSyntax59implements PrintJobAttribute {6061private static final long serialVersionUID = 6722648442432393294L;6263/**64* Construct a new job impressions completed attribute with the given65* integer value.66*67* @param value Integer value.68*69* @exception IllegalArgumentException70* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.71*/72public JobImpressionsCompleted(int value) {73super (value, 0, Integer.MAX_VALUE);74}7576/**77* Returns whether this job impressions completed attribute is equivalent78* tp the passed in object. To be equivalent, all of the following79* conditions must be true:80* <OL TYPE=1>81* <LI>82* <CODE>object</CODE> is not null.83* <LI>84* <CODE>object</CODE> is an instance of class JobImpressionsCompleted.85* <LI>86* This job impressions completed attribute's value and87* <CODE>object</CODE>'s value are equal.88* </OL>89*90* @param object Object to compare to.91*92* @return True if <CODE>object</CODE> is equivalent to this job93* impressions completed attribute, false otherwise.94*/95public boolean equals(Object object) {96return(super.equals (object) &&97object instanceof JobImpressionsCompleted);98}99100/**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 JobImpressionsCompleted, the category is class105* JobImpressionsCompleted itself.106*107* @return Printing attribute class (category), an instance of class108* {@link java.lang.Class java.lang.Class}.109*/110public final Class<? extends Attribute> getCategory() {111return JobImpressionsCompleted.class;112}113114/**115* Get the name of the category of which this attribute value is an116* instance.117* <P>118* For class JobImpressionsCompleted, the category name is119* <CODE>"job-impressions-completed"</CODE>.120*121* @return Attribute category name.122*/123public final String getName() {124return "job-impressions-completed";125}126127}128129130