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/Compression.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.DocAttribute;
32
import javax.print.attribute.EnumSyntax;
33
34
/**
35
* Class {@code Compression} is a printing attribute class, an enumeration, that
36
* specifies how print data is compressed. {@code Compression} is an attribute
37
* of the print data (the doc), not of the Print Job. If a {@code Compression}
38
* attribute is not specified for a doc, the printer assumes the doc's print
39
* data is uncompressed (i.e., the default Compression value is always
40
* {@link #NONE NONE}).
41
* <p>
42
* <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
43
* the IPP attribute name. The enumeration's integer value is the IPP enum
44
* value. The {@code toString()} method returns the IPP string representation of
45
* the attribute value.
46
*
47
* @author Alan Kaminsky
48
*/
49
public class Compression extends EnumSyntax implements DocAttribute {
50
51
/**
52
* Use serialVersionUID from JDK 1.4 for interoperability.
53
*/
54
@Serial
55
private static final long serialVersionUID = -5716748913324997674L;
56
57
/**
58
* No compression is used.
59
*/
60
public static final Compression NONE = new Compression(0);
61
62
/**
63
* ZIP public domain inflate/deflate compression technology.
64
*/
65
public static final Compression DEFLATE = new Compression(1);
66
67
/**
68
* GNU zip compression technology described in
69
* <a href="http://www.ietf.org/rfc/rfc1952.txt">RFC 1952</a>.
70
*/
71
public static final Compression GZIP = new Compression(2);
72
73
/**
74
* UNIX compression technology.
75
*/
76
public static final Compression COMPRESS = new Compression(3);
77
78
/**
79
* Construct a new compression enumeration value with the given integer
80
* value.
81
*
82
* @param value Integer value
83
*/
84
protected Compression(int value) {
85
super(value);
86
}
87
88
/**
89
* The string table for class {@code Compression}.
90
*/
91
private static final String[] myStringTable = {"none",
92
"deflate",
93
"gzip",
94
"compress"};
95
96
/**
97
* The enumeration value table for class {@code Compression}.
98
*/
99
private static final Compression[] myEnumValueTable = {NONE,
100
DEFLATE,
101
GZIP,
102
COMPRESS};
103
104
/**
105
* Returns the string table for class {@code Compression}.
106
*/
107
protected String[] getStringTable() {
108
return myStringTable.clone();
109
}
110
111
/**
112
* Returns the enumeration value table for class {@code Compression}.
113
*/
114
protected EnumSyntax[] getEnumValueTable() {
115
return (EnumSyntax[])myEnumValueTable.clone();
116
}
117
118
/**
119
* Get the printing attribute class which is to be used as the "category"
120
* for this printing attribute value.
121
* <p>
122
* For class {@code Compression} and any vendor-defined subclasses, the
123
* category is class {@code Compression} itself.
124
*
125
* @return printing attribute class (category), an instance of class
126
* {@link Class java.lang.Class}
127
*/
128
public final Class<? extends Attribute> getCategory() {
129
return Compression.class;
130
}
131
132
/**
133
* Get the name of the category of which this attribute value is an
134
* instance.
135
* <p>
136
* For class {@code Compression} and any vendor-defined subclasses, the
137
* category name is {@code "compression"}.
138
*
139
* @return attribute category name
140
*/
141
public final String getName() {
142
return "compression";
143
}
144
}
145
146