Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/JobSheets.java
38918 views
/*1* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package javax.print.attribute.standard;2526import java.util.Locale;2728import javax.print.attribute.Attribute;29import javax.print.attribute.EnumSyntax;30import javax.print.attribute.PrintRequestAttribute;31import javax.print.attribute.PrintJobAttribute;3233/**34* Class JobSheets is a printing attribute class, an enumeration, that35* determines which job start and end sheets, if any, must be printed with a36* job. Class JobSheets declares keywords for standard job sheets values.37* Implementation- or site-defined names for a job sheets attribute may also be38* created by defining a subclass of class JobSheets.39* <P>40* The effect of a JobSheets attribute on multidoc print jobs (jobs with41* multiple documents) may be affected by the {@link MultipleDocumentHandling42* MultipleDocumentHandling} job attribute, depending on the meaning of the43* particular JobSheets value.44* <P>45* <B>IPP Compatibility:</B> The category name returned by46* <CODE>getName()</CODE> is the IPP attribute name. The47* enumeration's integer value is the IPP enum value. The48* <code>toString()</code> method returns the IPP string representation of49* the attribute value. For a subclass, the attribute value must be50* localized to give the IPP name and natural language values.51* <P>52*53* @author Alan Kaminsky54*/55public class JobSheets extends EnumSyntax56implements PrintRequestAttribute, PrintJobAttribute {5758private static final long serialVersionUID = -4735258056132519759L;5960/**61* No job sheets are printed.62*/63public static final JobSheets NONE = new JobSheets(0);6465/**66* One or more site specific standard job sheets are printed. e.g. a67* single start sheet is printed, or both start and end sheets are68* printed.69*/70public static final JobSheets STANDARD = new JobSheets(1);7172/**73* Construct a new job sheets enumeration value with the given integer74* value.75*76* @param value Integer value.77*/78protected JobSheets(int value) {79super (value);80}8182private static final String[] myStringTable = {83"none",84"standard"85};8687private static final JobSheets[] myEnumValueTable = {88NONE,89STANDARD90};9192/**93* Returns the string table for class JobSheets.94*/95protected String[] getStringTable() {96return (String[])myStringTable.clone();97}9899/**100* Returns the enumeration value table for class JobSheets.101*/102protected EnumSyntax[] getEnumValueTable() {103return (EnumSyntax[])myEnumValueTable.clone();104}105106/**107* Get the printing attribute class which is to be used as the "category"108* for this printing attribute value.109* <P>110* For class JobSheets and any vendor-defined subclasses, the category is111* class JobSheets itself.112*113* @return Printing attribute class (category), an instance of class114* {@link java.lang.Class java.lang.Class}.115*/116public final Class<? extends Attribute> getCategory() {117return JobSheets.class;118}119120/**121* Get the name of the category of which this attribute value is an122* instance.123* <P>124* For class JobSheets and any vendor-defined subclasses, the category125* name is <CODE>"job-sheets"</CODE>.126*127* @return Attribute category name.128*/129public final String getName() {130return "job-sheets";131}132133}134135136