Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/JobImpressions.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.PrintRequestAttribute;29import javax.print.attribute.PrintJobAttribute;3031/**32* Class JobImpressions is an integer valued printing attribute class that33* specifies the total size in number of impressions of the document(s) being34* submitted. An "impression" is the image (possibly many print-stream pages in35* different configurations) imposed onto a single media page.36* <P>37* The JobImpressions attribute describes the size of the job. This attribute is38* not intended to be a counter; it is intended to be useful routing and39* scheduling information if known. The printer may try to compute the40* JobImpressions attribute's value if it is not supplied in the Print Request.41* Even if the client does supply a value for the JobImpressions attribute in42* the Print Request, the printer may choose to change the value if the printer43* is able to compute a value which is more accurate than the client supplied44* value. The printer may be able to determine the correct value for the45* JobImpressions attribute either right at job submission time or at any later46* point in time.47* <P>48* As with {@link JobKOctets JobKOctets}, the JobImpressions value must not49* include the multiplicative factors contributed by the number of copies50* specified by the {@link Copies Copies} attribute, independent of whether the51* device can process multiple copies without making multiple passes over the52* job or document data and independent of whether the output is collated or53* not. Thus the value is independent of the implementation and reflects the54* size of the document(s) measured in impressions independent of the number of55* copies.56* <P>57* As with {@link JobKOctets JobKOctets}, the JobImpressions value must also not58* include the multiplicative factor due to a copies instruction embedded in the59* document data. If the document data actually includes replications of the60* document data, this value will include such replication. In other words, this61* value is always the number of impressions in the source document data, rather62* than a measure of the number of impressions to be produced by the job.63* <P>64* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The65* category name returned by <CODE>getName()</CODE> gives the IPP attribute66* name.67* <P>68*69* @see JobImpressionsSupported70* @see JobImpressionsCompleted71* @see JobKOctets72* @see JobMediaSheets73*74* @author Alan Kaminsky75*/76public final class JobImpressions extends IntegerSyntax77implements PrintRequestAttribute, PrintJobAttribute {7879private static final long serialVersionUID = 8225537206784322464L;808182/**83* Construct a new job impressions attribute with the given integer value.84*85* @param value Integer value.86*87* @exception IllegalArgumentException88* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.89*/90public JobImpressions(int value) {91super(value, 0, Integer.MAX_VALUE);92}9394/**95* Returns whether this job impressions attribute is equivalent to the96* passed in object. To be equivalent, all of the following conditions must97* be true:98* <OL TYPE=1>99* <LI>100* <CODE>object</CODE> is not null.101* <LI>102* <CODE>object</CODE> is an instance of class JobImpressions.103* <LI>104* This job impressions attribute's value and <CODE>object</CODE>'s value105* are equal.106* </OL>107*108* @param object Object to compare to.109*110* @return True if <CODE>object</CODE> is equivalent to this job111* impressions attribute, false otherwise.112*/113public boolean equals(Object object) {114return super.equals (object) && object instanceof JobImpressions;115}116117/**118* Get the printing attribute class which is to be used as the "category"119* for this printing attribute value.120* <P>121* For class JobImpressions, the category is class JobImpressions itself.122*123* @return Printing attribute class (category), an instance of class124* {@link java.lang.Class java.lang.Class}.125*/126public final Class<? extends Attribute> getCategory() {127return JobImpressions.class;128}129130/**131* Get the name of the category of which this attribute value is an132* instance.133* <P>134* For class JobImpressions, the category name is135* <CODE>"job-impressions"</CODE>.136*137* @return Attribute category name.138*/139public final String getName() {140return "job-impressions";141}142143}144145146