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: import javax.print.attribute.PrintRequestAttribute;
24:
25: /*
26: * Table values are obtained from RFC2911: Internet Printing Protocol/1.1:
27: * Model and Semantics, section 4.2.4, http://ietf.org/rfc/rfc2911.txt?number=2911
28: */
29: public class MultipleDocumentHandling extends EnumSyntax implements
30: PrintJobAttribute, PrintRequestAttribute {
31: private static final long serialVersionUID = 8098326460746413466L;
32:
33: public static final MultipleDocumentHandling SINGLE_DOCUMENT = new MultipleDocumentHandling(
34: 0);
35:
36: public static final MultipleDocumentHandling SEPARATE_DOCUMENTS_UNCOLLATED_COPIES = new MultipleDocumentHandling(
37: 1);
38:
39: public static final MultipleDocumentHandling SEPARATE_DOCUMENTS_COLLATED_COPIES = new MultipleDocumentHandling(
40: 2);
41:
42: public static final MultipleDocumentHandling SINGLE_DOCUMENT_NEW_SHEET = new MultipleDocumentHandling(
43: 3);
44:
45: private static final MultipleDocumentHandling[] enumValueTable = {
46: SINGLE_DOCUMENT, SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
47: SEPARATE_DOCUMENTS_COLLATED_COPIES,
48: SINGLE_DOCUMENT_NEW_SHEET };
49:
50: private static final String[] stringTable = { "single-document",
51: "separate-documents-uncollated-copies",
52: "separate-documents-collated-copies",
53: "single-document-new-sheet" };
54:
55: protected MultipleDocumentHandling(int value) {
56: super (value);
57: }
58:
59: public final Class<? extends Attribute> getCategory() {
60: return MultipleDocumentHandling.class;
61: }
62:
63: @Override
64: protected EnumSyntax[] getEnumValueTable() {
65: return enumValueTable.clone();
66: }
67:
68: public final String getName() {
69: return "multiple-document-handling";
70: }
71:
72: @Override
73: protected String[] getStringTable() {
74: return stringTable.clone();
75: }
76: }
|