Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java
41161 views
/*1* Copyright (c) 2000, 2021, 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*/2425package javax.print.attribute.standard;2627import java.io.Serial;2829import javax.print.attribute.Attribute;30import javax.print.attribute.IntegerSyntax;31import javax.print.attribute.PrintJobAttribute;3233/**34* Class {@code JobImpressionsCompleted} is an integer valued printing attribute35* class that specifies the number of impressions completed for the job so far.36* For printing devices, the impressions completed includes interpreting,37* marking, and stacking the output.38* <p>39* The {@code JobImpressionsCompleted} attribute describes the progress of the40* job. This attribute is intended to be a counter. That is, the41* {@code JobImpressionsCompleted} value for a job that has not started42* processing must be 0. When the job's {@link JobState JobState} is43* {@code PROCESSING} or {@code PROCESSING_STOPPED}, the44* {@code JobImpressionsCompleted} value is intended to increase as the job is45* processed; it indicates the amount of the job that has been processed at the46* time the Print Job's attribute set is queried or at the time a print job47* event is reported. When the job enters the {@code COMPLETED},48* {@code CANCELED}, or {@code ABORTED} states, the49* {@code JobImpressionsCompleted} value is the final value for the job.50* <p>51* <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The52* category name returned by {@code getName()} gives the IPP attribute name.53*54* @author Alan Kaminsky55* @see JobImpressions56* @see JobImpressionsSupported57* @see JobKOctetsProcessed58* @see JobMediaSheetsCompleted59*/60public final class JobImpressionsCompleted extends IntegerSyntax61implements PrintJobAttribute {6263/**64* Use serialVersionUID from JDK 1.4 for interoperability.65*/66@Serial67private static final long serialVersionUID = 6722648442432393294L;6869/**70* Construct a new job impressions completed attribute with the given71* integer value.72*73* @param value Integer value74* @throws IllegalArgumentException if {@code value} is negative75*/76public JobImpressionsCompleted(int value) {77super (value, 0, Integer.MAX_VALUE);78}7980/**81* Returns whether this job impressions completed attribute is equivalent tp82* the passed in object. To be equivalent, all of the following conditions83* must be true:84* <ol type=1>85* <li>{@code object} is not {@code null}.86* <li>{@code object} is an instance of class87* {@code JobImpressionsCompleted}.88* <li>This job impressions completed attribute's value and89* {@code object}'s value are equal.90* </ol>91*92* @param object {@code Object} to compare to93* @return {@code true} if {@code object} is equivalent to this job94* impressions completed attribute, {@code false} otherwise95*/96public boolean equals(Object object) {97return(super.equals (object) &&98object instanceof JobImpressionsCompleted);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 {@code JobImpressionsCompleted}, the category is class106* {@code JobImpressionsCompleted} itself.107*108* @return printing attribute class (category), an instance of class109* {@link Class java.lang.Class}110*/111public final Class<? extends Attribute> getCategory() {112return JobImpressionsCompleted.class;113}114115/**116* Get the name of the category of which this attribute value is an117* instance.118* <p>119* For class {@code JobImpressionsCompleted}, the category name is120* {@code "job-impressions-completed"}.121*122* @return attribute category name123*/124public final String getName() {125return "job-impressions-completed";126}127}128129130