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 Copies is an integer valued printing attribute class that specifies the
0N/A * number of copies to be printed.
0N/A * <P>
0N/A * On many devices the supported number of collated copies will be limited by
0N/A * the number of physical output bins on the device, and may be different from
0N/A * the number of uncollated copies which can be supported.
0N/A * <P>
0N/A * The effect of a Copies attribute with a value of <I>n</I> on a multidoc print
0N/A * job (a job with multiple documents) depends on the (perhaps defaulted) value
0N/A * of the {@link MultipleDocumentHandling MultipleDocumentHandling} attribute:
0N/A * <UL>
0N/A * <LI>
0N/A * SINGLE_DOCUMENT -- The result will be <I>n</I> copies of a single output
0N/A * document comprising all the input docs.
0N/A * <P>
0N/A * <LI>
0N/A * SINGLE_DOCUMENT_NEW_SHEET -- The result will be <I>n</I> copies of a single
0N/A * output document comprising all the input docs, and the first impression of
0N/A * each input doc will always start on a new media sheet.
0N/A * <P>
0N/A * <LI>
0N/A * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The result will be <I>n</I> copies of
0N/A * the first input document, followed by <I>n</I> copies of the second input
0N/A * document, . . . followed by <I>n</I> copies of the last input document.
0N/A * <P>
0N/A * <LI>
0N/A * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The result will be the first input
0N/A * document, the second input document, . . . the last input document, the group
0N/A * of documents being repeated <I>n</I> times.
0N/A * </UL>
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 * @author David Mendenhall
0N/A * @author Alan Kamihensky
0N/A */
0N/Apublic final class Copies extends IntegerSyntax
0N/A implements PrintRequestAttribute, PrintJobAttribute {
0N/A
0N/A private static final long serialVersionUID = -6426631521680023833L;
0N/A
0N/A /**
0N/A * Construct a new copies 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 1.
0N/A */
0N/A public Copies(int value) {
0N/A super (value, 1, Integer.MAX_VALUE);
0N/A }
0N/A
0N/A /**
0N/A * Returns whether this copies attribute is equivalent to the passed in
0N/A * object. To be equivalent, all of the following conditions must 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 Copies.
0N/A * <LI>
0N/A * This copies attribute's value and <CODE>object</CODE>'s value are
0N/A * 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 copies
0N/A * attribute, false otherwise.
0N/A */
0N/A public boolean equals(Object object) {
0N/A return super.equals (object) && object instanceof Copies;
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 Copies, the category is class Copies 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 Copies.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 Copies, the category name is <CODE>"copies"</CODE>.
0N/A *
0N/A * @return Attribute category name.
0N/A */
0N/A public final String getName() {
0N/A return "copies";
0N/A }
0N/A
0N/A}