01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.print.attribute.standard;
19:
20: import javax.print.attribute.Attribute;
21: import javax.print.attribute.EnumSyntax;
22: import javax.print.attribute.PrintJobAttribute;
23:
24: /*
25: * Table values are obtained from RFC2911: Internet Printing Protocol/1.1:
26: * Model and Semantics, section 4.3.7, http://ietf.org/rfc/rfc2911.txt?number=2911
27: */
28: public class JobState extends EnumSyntax implements PrintJobAttribute {
29: private static final long serialVersionUID = 400465010094018920L;
30:
31: public static final JobState UNKNOWN = new JobState(0);
32:
33: public static final JobState PENDING = new JobState(3);
34:
35: public static final JobState PENDING_HELD = new JobState(4);
36:
37: public static final JobState PROCESSING = new JobState(5);
38:
39: public static final JobState PROCESSING_STOPPED = new JobState(6);
40:
41: public static final JobState CANCELED = new JobState(7);
42:
43: public static final JobState ABORTED = new JobState(8);
44:
45: public static final JobState COMPLETED = new JobState(9);
46:
47: private static final JobState[] enumValueTable = { UNKNOWN, null,
48: null, PENDING, PENDING_HELD, PROCESSING,
49: PROCESSING_STOPPED, CANCELED, ABORTED, COMPLETED };
50:
51: private static final String[] stringTable = { "unknown", null,
52: null, "pending", "pending-held", "processing",
53: "processing-stopped", "canceled", "aborted", "completed" };
54:
55: protected JobState(int value) {
56: super (value);
57: }
58:
59: @Override
60: protected EnumSyntax[] getEnumValueTable() {
61: return enumValueTable.clone();
62: }
63:
64: public final Class<? extends Attribute> getCategory() {
65: return JobState.class;
66: }
67:
68: public final String getName() {
69: return "job-state";
70: }
71:
72: @Override
73: protected String[] getStringTable() {
74: return stringTable.clone();
75: }
76: }
|