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/JobImpressionsCompleted.java
41161 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.PrintJobAttribute;
33
34
/**
35
* Class {@code JobImpressionsCompleted} is an integer valued printing attribute
36
* class that specifies the number of impressions completed for the job so far.
37
* For printing devices, the impressions completed includes interpreting,
38
* marking, and stacking the output.
39
* <p>
40
* The {@code JobImpressionsCompleted} attribute describes the progress of the
41
* job. This attribute is intended to be a counter. That is, the
42
* {@code JobImpressionsCompleted} value for a job that has not started
43
* processing must be 0. When the job's {@link JobState JobState} is
44
* {@code PROCESSING} or {@code PROCESSING_STOPPED}, the
45
* {@code JobImpressionsCompleted} value is intended to increase as the job is
46
* processed; it indicates the amount of the job that has been processed at the
47
* time the Print Job's attribute set is queried or at the time a print job
48
* event is reported. When the job enters the {@code COMPLETED},
49
* {@code CANCELED}, or {@code ABORTED} states, the
50
* {@code JobImpressionsCompleted} value is the final value for the job.
51
* <p>
52
* <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The
53
* category name returned by {@code getName()} gives the IPP attribute name.
54
*
55
* @author Alan Kaminsky
56
* @see JobImpressions
57
* @see JobImpressionsSupported
58
* @see JobKOctetsProcessed
59
* @see JobMediaSheetsCompleted
60
*/
61
public final class JobImpressionsCompleted extends IntegerSyntax
62
implements PrintJobAttribute {
63
64
/**
65
* Use serialVersionUID from JDK 1.4 for interoperability.
66
*/
67
@Serial
68
private static final long serialVersionUID = 6722648442432393294L;
69
70
/**
71
* Construct a new job impressions completed attribute with the given
72
* integer value.
73
*
74
* @param value Integer value
75
* @throws IllegalArgumentException if {@code value} is negative
76
*/
77
public JobImpressionsCompleted(int value) {
78
super (value, 0, Integer.MAX_VALUE);
79
}
80
81
/**
82
* Returns whether this job impressions completed attribute is equivalent tp
83
* the passed in object. To be equivalent, all of the following conditions
84
* must be true:
85
* <ol type=1>
86
* <li>{@code object} is not {@code null}.
87
* <li>{@code object} is an instance of class
88
* {@code JobImpressionsCompleted}.
89
* <li>This job impressions completed attribute's value and
90
* {@code object}'s value are equal.
91
* </ol>
92
*
93
* @param object {@code Object} to compare to
94
* @return {@code true} if {@code object} is equivalent to this job
95
* impressions completed attribute, {@code false} otherwise
96
*/
97
public boolean equals(Object object) {
98
return(super.equals (object) &&
99
object instanceof JobImpressionsCompleted);
100
}
101
102
/**
103
* Get the printing attribute class which is to be used as the "category"
104
* for this printing attribute value.
105
* <p>
106
* For class {@code JobImpressionsCompleted}, the category is class
107
* {@code JobImpressionsCompleted} itself.
108
*
109
* @return printing attribute class (category), an instance of class
110
* {@link Class java.lang.Class}
111
*/
112
public final Class<? extends Attribute> getCategory() {
113
return JobImpressionsCompleted.class;
114
}
115
116
/**
117
* Get the name of the category of which this attribute value is an
118
* instance.
119
* <p>
120
* For class {@code JobImpressionsCompleted}, the category name is
121
* {@code "job-impressions-completed"}.
122
*
123
* @return attribute category name
124
*/
125
public final String getName() {
126
return "job-impressions-completed";
127
}
128
}
129
130