Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.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 JobMediaSheetsCompleted is an integer valued printing attribute class32* that specifies the number of media sheets which have completed marking and33* stacking for the entire job so far, whether those sheets have been processed34* on one side or on both.35* <P>36* The JobMediaSheetsCompleted attribute describes the progress of the job. This37* attribute is intended to be a counter. That is, the JobMediaSheetsCompleted38* 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* JobMediaSheetsCompleted 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 JobMediaSheetsCompleted 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 JobMediaSheets52* @see JobMediaSheetsSupported53* @see JobKOctetsProcessed54* @see JobImpressionsCompleted55*56* @author Alan Kaminsky57*/58public final class JobMediaSheetsCompleted extends IntegerSyntax59implements PrintJobAttribute {606162private static final long serialVersionUID = 1739595973810840475L;6364/**65* Construct a new job media sheets completed attribute with the given66* integer value.67*68* @param value Integer value.69*70* @exception IllegalArgumentException71* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.72*/73public JobMediaSheetsCompleted(int value) {74super (value, 0, Integer.MAX_VALUE);75}7677/**78* Returns whether this job media sheets completed attribute is equivalent79* to the passed in object. To be equivalent, all of the following80* conditions must 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 JobMediaSheetsCompleted.86* <LI>87* This job media sheets completed attribute's value and88* <CODE>object</CODE>'s value 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 media94* sheets completed attribute, false otherwise.95*/96public boolean equals(Object object) {97return (super.equals (object) &&98object instanceof JobMediaSheetsCompleted);99}100101/**102* Get the printing attribute class which is to be used as the "category"103* for this printing attribute value.104* <P>105* For class JobMediaSheetsCompleted, the category is class106* JobMediaSheetsCompleted itself.107*108* @return Printing attribute class (category), an instance of class109* {@link java.lang.Class java.lang.Class}.110*/111public final Class<? extends Attribute> getCategory() {112return JobMediaSheetsCompleted.class;113}114115/**116* Get the name of the category of which this attribute value is an117* instance.118* <P>119* For class JobMediaSheetsCompleted, the category name is120* <CODE>"job-media-sheets-completed"</CODE>.121*122* @return Attribute category name.123*/124public final String getName() {125return "job-media-sheets-completed";126}127}128129130