Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/MediaName.java
38918 views
/*1* Copyright (c) 2000, 2003, 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;27import javax.print.attribute.Attribute;28import javax.print.attribute.EnumSyntax;2930/**31* Class MediaName is a subclass of Media, a printing attribute class (an32* enumeration) that specifies the media for a print job as a name.33* <P>34* This attribute can be used instead of specifying MediaSize or MediaTray.35* <p>36* Class MediaName currently declares a few standard media names.37* Implementation- or site-defined names for a media name attribute may also38* be created by defining a subclass of class MediaName.39* <P>40* <B>IPP Compatibility:</B> MediaName is a representation class for41* values of the IPP "media" attribute which names media.42* <P>43*44*/45public class MediaName extends Media implements Attribute {4647private static final long serialVersionUID = 4653117714524155448L;4849/**50* white letter paper.51*/52public static final MediaName NA_LETTER_WHITE = new MediaName(0);5354/**55* letter transparency.56*/57public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);5859/**60* white A4 paper.61*/62public static final MediaName ISO_A4_WHITE = new MediaName(2);636465/**66* A4 transparency.67*/68public static final MediaName ISO_A4_TRANSPARENT= new MediaName(3);697071/**72* Constructs a new media name enumeration value with the given integer73* value.74*75* @param value Integer value.76*/77protected MediaName(int value) {78super (value);79}8081private static final String[] myStringTable = {82"na-letter-white",83"na-letter-transparent",84"iso-a4-white",85"iso-a4-transparent"86};8788private static final MediaName[] myEnumValueTable = {89NA_LETTER_WHITE,90NA_LETTER_TRANSPARENT,91ISO_A4_WHITE,92ISO_A4_TRANSPARENT93};9495/**96* Returns the string table for class MediaTray.97* @return the String table.98*/99protected String[] getStringTable()100{101return (String[])myStringTable.clone();102}103104/**105* Returns the enumeration value table for class MediaTray.106* @return the enumeration value table.107*/108protected EnumSyntax[] getEnumValueTable() {109return (EnumSyntax[])myEnumValueTable.clone();110}111112}113114115