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/PagesPerMinute.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.IntegerSyntax;
32
import javax.print.attribute.PrintServiceAttribute;
33
34
/**
35
* Class {@code PagesPerMinute} is an integer valued printing attribute that
36
* indicates the nominal number of pages per minute to the nearest whole number
37
* which may be generated by this printer (e.g., simplex, black-and-white). This
38
* attribute is informative, not a service guarantee. Generally, it is the value
39
* used in the marketing literature to describe the device. A value of 0
40
* indicates a device that takes more than two minutes to process a page.
41
* <p>
42
* <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
43
* category name returned by {@code getName()} gives the IPP attribute name.
44
*
45
* @author Alan Kaminsky
46
*/
47
public final class PagesPerMinute extends IntegerSyntax
48
implements PrintServiceAttribute {
49
50
/**
51
* Use serialVersionUID from JDK 1.4 for interoperability.
52
*/
53
@Serial
54
private static final long serialVersionUID = -6366403993072862015L;
55
56
/**
57
* Construct a new pages per minute attribute with the given integer value.
58
*
59
* @param value Integer value
60
* @throws IllegalArgumentException if {@code value} is negative
61
*/
62
public PagesPerMinute(int value) {
63
super(value, 0, Integer.MAX_VALUE);
64
}
65
66
/**
67
* Returns whether this pages per minute attribute is equivalent to the
68
* passed in object. To be equivalent, all of the following conditions must
69
* be true:
70
* <ol type=1>
71
* <li>{@code object} is not {@code null}.
72
* <li>{@code object} is an instance of class {@code PagesPerMinute}.
73
* <li>This pages per minute attribute's value and {@code object}'s value
74
* are equal.
75
* </ol>
76
*
77
* @param object {@code Object} to compare to
78
* @return {@code true} if {@code object} is equivalent to this pages per
79
* minute attribute, {@code false} otherwise
80
*/
81
public boolean equals(Object object) {
82
return (super.equals (object) &&
83
object instanceof PagesPerMinute);
84
}
85
86
/**
87
* Get the printing attribute class which is to be used as the "category"
88
* for this printing attribute value.
89
* <p>
90
* For class {@code PagesPerMinute}, the category is class
91
* {@code PagesPerMinute} itself.
92
*
93
* @return printing attribute class (category), an instance of class
94
* {@link Class java.lang.Class}
95
*/
96
public final Class<? extends Attribute> getCategory() {
97
return PagesPerMinute.class;
98
}
99
100
/**
101
* Get the name of the category of which this attribute value is an
102
* instance.
103
* <p>
104
* For class {@code PagesPerMinute}, the category name is
105
* {@code "pages-per-minute"}.
106
*
107
* @return attribute category name
108
*/
109
public final String getName() {
110
return "pages-per-minute";
111
}
112
}
113
114