0N/A/*
2362N/A * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/Apackage javax.print.attribute.standard;
0N/A
0N/Aimport javax.print.attribute.Attribute;
0N/Aimport javax.print.attribute.IntegerSyntax;
0N/Aimport javax.print.attribute.PrintRequestAttribute;
0N/Aimport javax.print.attribute.PrintJobAttribute;
0N/A
0N/A/**
0N/A * Class JobImpressions is an integer valued printing attribute class that
0N/A * specifies the total size in number of impressions of the document(s) being
0N/A * submitted. An "impression" is the image (possibly many print-stream pages in
0N/A * different configurations) imposed onto a single media page.
0N/A * <P>
0N/A * The JobImpressions attribute describes the size of the job. This attribute is
0N/A * not intended to be a counter; it is intended to be useful routing and
0N/A * scheduling information if known. The printer may try to compute the
0N/A * JobImpressions attribute's value if it is not supplied in the Print Request.
0N/A * Even if the client does supply a value for the JobImpressions attribute in
0N/A * the Print Request, the printer may choose to change the value if the printer
0N/A * is able to compute a value which is more accurate than the client supplied
0N/A * value. The printer may be able to determine the correct value for the
0N/A * JobImpressions attribute either right at job submission time or at any later
0N/A * point in time.
0N/A * <P>
0N/A * As with {@link JobKOctets JobKOctets}, the JobImpressions value must not
0N/A * include the multiplicative factors contributed by the number of copies
0N/A * specified by the {@link Copies Copies} attribute, independent of whether the
0N/A * device can process multiple copies without making multiple passes over the
0N/A * job or document data and independent of whether the output is collated or
0N/A * not. Thus the value is independent of the implementation and reflects the
0N/A * size of the document(s) measured in impressions independent of the number of
0N/A * copies.
0N/A * <P>
0N/A * As with {@link JobKOctets JobKOctets}, the JobImpressions value must also not
0N/A * include the multiplicative factor due to a copies instruction embedded in the
0N/A * document data. If the document data actually includes replications of the
0N/A * document data, this value will include such replication. In other words, this
0N/A * value is always the number of impressions in the source document data, rather
0N/A * than a measure of the number of impressions to be produced by the job.
0N/A * <P>
0N/A * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
0N/A * category name returned by <CODE>getName()</CODE> gives the IPP attribute
0N/A * name.
0N/A * <P>
0N/A *
0N/A * @see JobImpressionsSupported
0N/A * @see JobImpressionsCompleted
0N/A * @see JobKOctets
0N/A * @see JobMediaSheets
0N/A *
0N/A * @author Alan Kaminsky
0N/A */
0N/Apublic final class JobImpressions extends IntegerSyntax
0N/A implements PrintRequestAttribute, PrintJobAttribute {
0N/A
0N/A private static final long serialVersionUID = 8225537206784322464L;
0N/A
0N/A
0N/A /**
0N/A * Construct a new job impressions attribute with the given integer value.
0N/A *
0N/A * @param value Integer value.
0N/A *
0N/A * @exception IllegalArgumentException
0N/A * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
0N/A */
0N/A public JobImpressions(int value) {
0N/A super(value, 0, Integer.MAX_VALUE);
0N/A }
0N/A
0N/A /**
0N/A * Returns whether this job impressions attribute is equivalent to the
0N/A * passed in object. To be equivalent, all of the following conditions must
0N/A * be true:
0N/A * <OL TYPE=1>
0N/A * <LI>
0N/A * <CODE>object</CODE> is not null.
0N/A * <LI>
0N/A * <CODE>object</CODE> is an instance of class JobImpressions.
0N/A * <LI>
0N/A * This job impressions attribute's value and <CODE>object</CODE>'s value
0N/A * are equal.
0N/A * </OL>
0N/A *
0N/A * @param object Object to compare to.
0N/A *
0N/A * @return True if <CODE>object</CODE> is equivalent to this job
0N/A * impressions attribute, false otherwise.
0N/A */
0N/A public boolean equals(Object object) {
0N/A return super.equals (object) && object instanceof JobImpressions;
0N/A }
0N/A
0N/A /**
0N/A * Get the printing attribute class which is to be used as the "category"
0N/A * for this printing attribute value.
0N/A * <P>
0N/A * For class JobImpressions, the category is class JobImpressions itself.
0N/A *
0N/A * @return Printing attribute class (category), an instance of class
0N/A * {@link java.lang.Class java.lang.Class}.
0N/A */
0N/A public final Class<? extends Attribute> getCategory() {
0N/A return JobImpressions.class;
0N/A }
0N/A
0N/A /**
0N/A * Get the name of the category of which this attribute value is an
0N/A * instance.
0N/A * <P>
0N/A * For class JobImpressions, the category name is
0N/A * <CODE>"job-impressions"</CODE>.
0N/A *
0N/A * @return Attribute category name.
0N/A */
0N/A public final String getName() {
0N/A return "job-impressions";
0N/A }
0N/A
0N/A}