1 /*
2 * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
27 import javax.print.attribute.Attribute;
28 import javax.print.attribute.IntegerSyntax;
29 import javax.print.attribute.PrintRequestAttribute;
30 import javax.print.attribute.PrintJobAttribute;
31
32 /**
33 * Class Copies is an integer valued printing attribute class that specifies the
34 * number of copies to be printed.
35 * <P>
36 * On many devices the supported number of collated copies will be limited by
37 * the number of physical output bins on the device, and may be different from
38 * the number of uncollated copies which can be supported.
39 * <P>
40 * The effect of a Copies attribute with a value of <I>n</I> on a multidoc print
41 * job (a job with multiple documents) depends on the (perhaps defaulted) value
42 * of the {@link MultipleDocumentHandling MultipleDocumentHandling} attribute:
43 * <UL>
44 * <LI>
45 * SINGLE_DOCUMENT -- The result will be <I>n</I> copies of a single output
46 * document comprising all the input docs.
47 * <P>
48 * <LI>
49 * SINGLE_DOCUMENT_NEW_SHEET -- The result will be <I>n</I> copies of a single
50 * output document comprising all the input docs, and the first impression of
51 * each input doc will always start on a new media sheet.
52 * <P>
53 * <LI>
54 * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The result will be <I>n</I> copies of
55 * the first input document, followed by <I>n</I> copies of the second input
56 * document, . . . followed by <I>n</I> copies of the last input document.
57 * <P>
58 * <LI>
59 * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The result will be the first input
60 * document, the second input document, . . . the last input document, the group
61 * of documents being repeated <I>n</I> times.
62 * </UL>
63 * <P>
64 * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
65 * category name returned by <CODE>getName()</CODE> gives the IPP attribute
66 * name.
67 * <P>
68 *
69 * @author David Mendenhall
70 * @author Alan Kamihensky
71 */
72 public final class Copies extends IntegerSyntax
73 implements PrintRequestAttribute, PrintJobAttribute {
74
75 private static final long serialVersionUID = -6426631521680023833L;
76
77 /**
78 * Construct a new copies attribute with the given integer value.
79 *
80 * @param value Integer value.
81 *
82 * @exception IllegalArgumentException
83 * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1.
84 */
85 public Copies(int value) {
86 super (value, 1, Integer.MAX_VALUE);
87 }
|
1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
27 import javax.print.attribute.Attribute;
28 import javax.print.attribute.IntegerSyntax;
29 import javax.print.attribute.PrintRequestAttribute;
30 import javax.print.attribute.PrintJobAttribute;
31
32 /**
33 * Class Copies is an integer valued printing attribute class that specifies the
34 * number of copies to be printed.
35 * <P>
36 * On many devices the supported number of collated copies will be limited by
37 * the number of physical output bins on the device, and may be different from
38 * the number of uncollated copies which can be supported.
39 * <P>
40 * The effect of a Copies attribute with a value of <I>n</I> on a multidoc print
41 * job (a job with multiple documents) depends on the (perhaps defaulted) value
42 * of the {@link MultipleDocumentHandling MultipleDocumentHandling} attribute:
43 * <UL>
44 * <LI>
45 * SINGLE_DOCUMENT -- The result will be <I>n</I> copies of a single output
46 * document comprising all the input docs.
47 *
48 * <LI>
49 * SINGLE_DOCUMENT_NEW_SHEET -- The result will be <I>n</I> copies of a single
50 * output document comprising all the input docs, and the first impression of
51 * each input doc will always start on a new media sheet.
52 *
53 * <LI>
54 * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The result will be <I>n</I> copies of
55 * the first input document, followed by <I>n</I> copies of the second input
56 * document, . . . followed by <I>n</I> copies of the last input document.
57 *
58 * <LI>
59 * SEPARATE_DOCUMENTS_COLLATED_COPIES -- The result will be the first input
60 * document, the second input document, . . . the last input document, the group
61 * of documents being repeated <I>n</I> times.
62 * </UL>
63 * <P>
64 * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
65 * category name returned by <CODE>getName()</CODE> gives the IPP attribute
66 * name.
67 *
68 * @author David Mendenhall
69 * @author Alan Kamihensky
70 */
71 public final class Copies extends IntegerSyntax
72 implements PrintRequestAttribute, PrintJobAttribute {
73
74 private static final long serialVersionUID = -6426631521680023833L;
75
76 /**
77 * Construct a new copies attribute with the given integer value.
78 *
79 * @param value Integer value.
80 *
81 * @exception IllegalArgumentException
82 * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1.
83 */
84 public Copies(int value) {
85 super (value, 1, Integer.MAX_VALUE);
86 }
|