Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java
41171 views
1
/*
2
* Copyright (c) 2000, 2021, 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
23
* questions.
24
*/
25
26
package javax.print.attribute.standard;
27
28
import java.io.Serial;
29
30
import javax.print.attribute.Attribute;
31
import javax.print.attribute.EnumSyntax;
32
import javax.print.attribute.PrintJobAttribute;
33
import javax.print.attribute.PrintRequestAttribute;
34
35
/**
36
* Class {@code MultipleDocumentHandling} is a printing attribute class, an
37
* enumeration, that controls finishing operations and the placement of one or
38
* more print-stream pages into impressions and onto media sheets. When the
39
* value of the {@link Copies Copies} attribute exceeds 1,
40
* {@code MultipleDocumentHandling} also controls the order in which the copies
41
* that result from processing the documents are produced. This attribute is
42
* relevant only for a multidoc print job consisting of two or more individual
43
* docs.
44
* <p>
45
* Briefly, {@code MultipleDocumentHandling} determines the relationship between
46
* the multiple input (electronic) documents fed into a multidoc print job and
47
* the output (physical) document or documents produced by the multidoc print
48
* job.
49
* There are two possibilities:
50
* <ul>
51
* <li>The multiple input documents are combined into a single output
52
* document. Finishing operations ({@link Finishings Finishings}), are
53
* performed on this single output document. The {@link Copies Copies}
54
* attribute tells how many copies of this single output document to produce.
55
* The {@code MultipleDocumentHandling} values {@code SINGLE_DOCUMENT} and
56
* {@code SINGLE_DOCUMENT_NEW_SHEET} specify two variations of this
57
* possibility.
58
* <li>The multiple input documents remain separate output documents.
59
* Finishing operations ({@link Finishings Finishings}), are performed on each
60
* output document separately. The {@link Copies Copies} attribute tells how
61
* many copies of each separate output document to produce. The
62
* {@code MultipleDocumentHandling} values
63
* {@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} and
64
* {@code SEPARATE_DOCUMENTS_COLLATED_COPIES} specify two variations of this
65
* possibility.
66
* </ul>
67
* In the detailed explanations below, if "{@code a}" represents an instance of
68
* document data, then the result of processing the data in document "{@code a}"
69
* is a sequence of media sheets represented by "{@code a(*)}".
70
* <p>
71
* The standard {@code MultipleDocumentHandling} values are:
72
* <ul>
73
* <li><a id="sdfi"></a>{@link #SINGLE_DOCUMENT <b>SINGLE_DOCUMENT</b>}. If a
74
* print job has multiple documents -- say, the document data is called
75
* {@code a} and {@code b} -- then the result of processing all the document
76
* data ({@code a} and then {@code b}) must be treated as a single sequence of
77
* media sheets for finishing operations; that is, finishing would be
78
* performed on the concatenation of the sequences {@code a(*),b(*)}. The
79
* printer must not force the data in each document instance to be formatted
80
* onto a new print-stream page, nor to start a new impression on a new media
81
* sheet. If more than one copy is made, the ordering of the sets of media
82
* sheets resulting from processing the document data must be
83
* {@code a(*),b(*),a(*),b(*),...}, and the printer object must force each
84
* copy ({@code a(*),b(*)}) to start on a new media sheet.
85
* <li><a id="sducfi"></a>{@link #SEPARATE_DOCUMENTS_UNCOLLATED_COPIES
86
* <b>SEPARATE_DOCUMENTS_UNCOLLATED_COPIES</b>}. If a print job has multiple
87
* documents -- say, the document data is called {@code a} and {@code b} --
88
* then the result of processing the data in each document instance must be
89
* treated as a single sequence of media sheets for finishing operations; that
90
* is, the sets {@code a(*)} and {@code b(*)} would each be finished
91
* separately. The printer must force each copy of the result of processing
92
* the data in a single document to start on a new media sheet. If more than
93
* one copy is made, the ordering of the sets of media sheets resulting from
94
* processing the document data must be {@code a(*),a(*),...,b(*),b(*)...}.
95
* <li><a id="sdccfi"></a>{@link #SEPARATE_DOCUMENTS_COLLATED_COPIES
96
* <b>SEPARATE_DOCUMENTS_COLLATED_COPIES</b>}. If a print job has multiple
97
* documents -- say, the document data is called {@code a} and {@code b} --
98
* then the result of processing the data in each document instance must be
99
* treated as a single sequence of media sheets for finishing operations; that
100
* is, the sets {@code a(*)} and {@code b(*)} would each be finished
101
* separately. The printer must force each copy of the result of processing
102
* the data in a single document to start on a new media sheet. If more than
103
* one copy is made, the ordering of the sets of media sheets resulting from
104
* processing the document data must be {@code a(*),b(*),a(*),b(*),...}.
105
* <li><a id="sdnsfi"></a>{@link #SINGLE_DOCUMENT_NEW_SHEET
106
* <b>SINGLE_DOCUMENT_NEW_SHEET</b>}. Same as SINGLE_DOCUMENT, except that the
107
* printer must ensure that the first impression of each document instance in
108
* the job is placed on a new media sheet. This value allows multiple
109
* documents to be stapled together with a single staple where each document
110
* starts on a new sheet.
111
* </ul>
112
* <p>
113
* {@code SINGLE_DOCUMENT} is the same as
114
* {@code SEPARATE_DOCUMENTS_COLLATED_COPIES} with respect to ordering of
115
* print-stream pages, but not media sheet generation, since
116
* {@code SINGLE_DOCUMENT} will put the first page of the next document on the
117
* back side of a sheet if an odd number of pages have been produced so far for
118
* the job, while {@code SEPARATE_DOCUMENTS_COLLATED_COPIES} always forces the
119
* next document or document copy on to a new sheet.
120
* <p>
121
* In addition, if a {@link Finishings Finishings} attribute of
122
* {@link Finishings#STAPLE STAPLE} is specified, then:
123
* <ul>
124
* <li>With {@code SINGLE_DOCUMENT}, documents {@code a} and {@code b} are
125
* stapled together as a single document with no regard to new sheets.
126
* <li>With {@code SINGLE_DOCUMENT_NEW_SHEET}, documents {@code a} and
127
* {@code b} are stapled together as a single document, but document {@code b}
128
* starts on a new sheet.
129
* <li>With {@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} and
130
* {@code SEPARATE_DOCUMENTS_COLLATED_COPIES}, documents {@code a} and
131
* {@code b} are stapled separately.
132
* </ul>
133
* <i>Note:</i> None of these values provide means to produce uncollated sheets
134
* within a document, i.e., where multiple copies of sheet <i>n</i> are produced
135
* before sheet <i>n</i>+1 of the same document. To specify that, see the
136
* {@link SheetCollate SheetCollate} attribute.
137
* <p>
138
* <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
139
* the IPP attribute name. The enumeration's integer value is the IPP enum
140
* value. The {@code toString()} method returns the IPP string representation of
141
* the attribute value.
142
*
143
* @author David Mendenhall
144
* @author Alan Kaminsky
145
* @see Copies
146
* @see Finishings
147
* @see NumberUp
148
* @see PageRanges
149
* @see SheetCollate
150
* @see Sides
151
*/
152
public class MultipleDocumentHandling extends EnumSyntax
153
implements PrintRequestAttribute, PrintJobAttribute {
154
155
/**
156
* Use serialVersionUID from JDK 1.4 for interoperability.
157
*/
158
@Serial
159
private static final long serialVersionUID = 8098326460746413466L;
160
161
/**
162
* Single document -- see above for <a href="#sdfi">further information</a>.
163
*/
164
public static final MultipleDocumentHandling
165
SINGLE_DOCUMENT = new MultipleDocumentHandling (0);
166
167
/**
168
* Separate documents uncollated copies -- see above for
169
* <a href="#sducfi">further information</a>.
170
*/
171
public static final MultipleDocumentHandling
172
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES = new MultipleDocumentHandling (1);
173
174
/**
175
* Separate documents collated copies -- see above for
176
* <a href="#sdccfi">further information</a>.
177
*/
178
public static final MultipleDocumentHandling
179
SEPARATE_DOCUMENTS_COLLATED_COPIES = new MultipleDocumentHandling (2);
180
181
/**
182
* Single document new sheet -- see above for <a href="#sdnsfi">further
183
* information</a>.
184
*/
185
public static final MultipleDocumentHandling
186
SINGLE_DOCUMENT_NEW_SHEET = new MultipleDocumentHandling (3);
187
188
189
/**
190
* Construct a new multiple document handling enumeration value with the
191
* given integer value.
192
*
193
* @param value Integer value
194
*/
195
protected MultipleDocumentHandling(int value) {
196
super (value);
197
}
198
199
/**
200
* The string table for class {@code MultipleDocumentHandling}.
201
*/
202
private static final String[] myStringTable = {
203
"single-document",
204
"separate-documents-uncollated-copies",
205
"separate-documents-collated-copies",
206
"single-document-new-sheet"
207
};
208
209
/**
210
* The enumeration value table for class {@code MultipleDocumentHandling}.
211
*/
212
private static final MultipleDocumentHandling[] myEnumValueTable = {
213
SINGLE_DOCUMENT,
214
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
215
SEPARATE_DOCUMENTS_COLLATED_COPIES,
216
SINGLE_DOCUMENT_NEW_SHEET
217
};
218
219
/**
220
* Returns the string table for class {@code MultipleDocumentHandling}.
221
*/
222
protected String[] getStringTable() {
223
return myStringTable.clone();
224
}
225
226
/**
227
* Returns the enumeration value table for class
228
* {@code MultipleDocumentHandling}.
229
*/
230
protected EnumSyntax[] getEnumValueTable() {
231
return (EnumSyntax[])myEnumValueTable.clone();
232
}
233
234
/**
235
* Get the printing attribute class which is to be used as the "category"
236
* for this printing attribute value.
237
* <p>
238
* For class {@code MultipleDocumentHandling} and any vendor-defined
239
* subclasses, the category is class {@code MultipleDocumentHandling}
240
* itself.
241
*
242
* @return printing attribute class (category), an instance of class
243
* {@link Class java.lang.Class}
244
*/
245
public final Class<? extends Attribute> getCategory() {
246
return MultipleDocumentHandling.class;
247
}
248
249
/**
250
* Get the name of the category of which this attribute value is an
251
* instance.
252
* <p>
253
* For class {@code MultipleDocumentHandling} and any vendor-defined
254
* subclasses, the category name is {@code "multiple-document-handling"}.
255
*
256
* @return attribute category name
257
*/
258
public final String getName() {
259
return "multiple-document-handling";
260
}
261
}
262
263