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/OutputDeviceAssigned.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
import java.util.Locale;
30
31
import javax.print.attribute.Attribute;
32
import javax.print.attribute.PrintJobAttribute;
33
import javax.print.attribute.TextSyntax;
34
35
/**
36
* Class {@code OutputDeviceAssigned} is a printing attribute class, a text
37
* attribute, that identifies the output device to which the service has
38
* assigned this job. If an output device implements an embedded Print Service
39
* instance, the printer need not set this attribute. If a print server
40
* implements a Print Service instance, the value may be empty (zero- length
41
* string) or not returned until the service assigns an output device to the
42
* job. This attribute is particularly useful when a single service supports
43
* multiple devices (so called "fan-out").
44
* <p>
45
* <b>IPP Compatibility:</b> The string value gives the IPP name value. The
46
* locale gives the IPP natural language. The category name returned by
47
* {@code getName()} gives the IPP attribute name.
48
*
49
* @author Alan Kaminsky
50
*/
51
public final class OutputDeviceAssigned extends TextSyntax
52
implements PrintJobAttribute {
53
54
/**
55
* Use serialVersionUID from JDK 1.4 for interoperability.
56
*/
57
@Serial
58
private static final long serialVersionUID = 5486733778854271081L;
59
60
/**
61
* Constructs a new output device assigned attribute with the given device
62
* name and locale.
63
*
64
* @param deviceName device name
65
* @param locale natural language of the text string. {@code null} is
66
* interpreted to mean the default locale as returned by
67
* {@code Locale.getDefault()}
68
* @throws NullPointerException if {@code deviceName} is {@code null}
69
*/
70
public OutputDeviceAssigned(String deviceName, Locale locale) {
71
72
super (deviceName, locale);
73
}
74
75
// Exported operations inherited and overridden from class Object.
76
77
/**
78
* Returns whether this output device assigned attribute is equivalent to
79
* the passed in object. To be equivalent, all of the following conditions
80
* must be true:
81
* <ol type=1>
82
* <li>{@code object} is not {@code null}.
83
* <li>{@code object} is an instance of class
84
* {@code OutputDeviceAssigned}.
85
* <li>This output device assigned attribute's underlying string and
86
* {@code object}'s underlying string are equal.
87
* <li>This output device assigned attribute's locale and {@code object}'s
88
* locale are equal.
89
* </ol>
90
*
91
* @param object {@code Object} to compare to
92
* @return {@code true} if {@code object} is equivalent to this output
93
* device assigned attribute, {@code false} otherwise
94
*/
95
public boolean equals(Object object) {
96
return (super.equals (object) &&
97
object instanceof OutputDeviceAssigned);
98
}
99
100
/**
101
* Get the printing attribute class which is to be used as the "category"
102
* for this printing attribute value.
103
* <p>
104
* For class {@code OutputDeviceAssigned}, the category is class
105
* {@code OutputDeviceAssigned} itself.
106
*
107
* @return printing attribute class (category), an instance of class
108
* {@link Class java.lang.Class}
109
*/
110
public final Class<? extends Attribute> getCategory() {
111
return OutputDeviceAssigned.class;
112
}
113
114
/**
115
* Get the name of the category of which this attribute value is an
116
* instance.
117
* <p>
118
* For class {@code OutputDeviceAssigned}, the category name is
119
* {@code "output-device-assigned"}.
120
*
121
* @return attribute category name
122
*/
123
public final String getName() {
124
return "output-device-assigned";
125
}
126
}
127
128