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/JobSheets.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 JobSheets} is a printing attribute class, an enumeration, that
37
* determines which job start and end sheets, if any, must be printed with a
38
* job. Class {@code JobSheets} declares keywords for standard job sheets
39
* values. Implementation- or site-defined names for a job sheets attribute may
40
* also be created by defining a subclass of class {@code JobSheets}.
41
* <p>
42
* The effect of a {@code JobSheets} attribute on multidoc print jobs (jobs with
43
* multiple documents) may be affected by the
44
* {@link MultipleDocumentHandling MultipleDocumentHandling} job attribute,
45
* depending on the meaning of the particular {@code JobSheets} value.
46
* <p>
47
* <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
48
* the IPP attribute name. The enumeration's integer value is the IPP enum
49
* value. The {@code toString()} method returns the IPP string representation of
50
* the attribute value. For a subclass, the attribute value must be localized to
51
* give the IPP name and natural language values.
52
*
53
* @author Alan Kaminsky
54
*/
55
public class JobSheets extends EnumSyntax
56
implements PrintRequestAttribute, PrintJobAttribute {
57
58
/**
59
* Use serialVersionUID from JDK 1.4 for interoperability.
60
*/
61
@Serial
62
private static final long serialVersionUID = -4735258056132519759L;
63
64
/**
65
* No job sheets are printed.
66
*/
67
public static final JobSheets NONE = new JobSheets(0);
68
69
/**
70
* One or more site specific standard job sheets are printed. e.g. a single
71
* start sheet is printed, or both start and end sheets are printed.
72
*/
73
public static final JobSheets STANDARD = new JobSheets(1);
74
75
/**
76
* Construct a new job sheets enumeration value with the given integer
77
* value.
78
*
79
* @param value Integer value
80
*/
81
protected JobSheets(int value) {
82
super (value);
83
}
84
85
/**
86
* The string table for class {@code JobSheets}.
87
*/
88
private static final String[] myStringTable = {
89
"none",
90
"standard"
91
};
92
93
/**
94
* The enumeration value table for class {@code JobSheets}.
95
*/
96
private static final JobSheets[] myEnumValueTable = {
97
NONE,
98
STANDARD
99
};
100
101
/**
102
* Returns the string table for class {@code JobSheets}.
103
*/
104
protected String[] getStringTable() {
105
return myStringTable.clone();
106
}
107
108
/**
109
* Returns the enumeration value table for class {@code JobSheets}.
110
*/
111
protected EnumSyntax[] getEnumValueTable() {
112
return (EnumSyntax[])myEnumValueTable.clone();
113
}
114
115
/**
116
* Get the printing attribute class which is to be used as the "category"
117
* for this printing attribute value.
118
* <p>
119
* For class {@code JobSheets} and any vendor-defined subclasses, the
120
* category is class {@code JobSheets} itself.
121
*
122
* @return printing attribute class (category), an instance of class
123
* {@link Class java.lang.Class}
124
*/
125
public final Class<? extends Attribute> getCategory() {
126
return JobSheets.class;
127
}
128
129
/**
130
* Get the name of the category of which this attribute value is an
131
* instance.
132
* <p>
133
* For class {@code JobSheets} and any vendor-defined subclasses, the
134
* category name is {@code "job-sheets"}.
135
*
136
* @return attribute category name
137
*/
138
public final String getName() {
139
return "job-sheets";
140
}
141
}
142
143