0N/A/*
2362N/A * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/Apackage javax.print.attribute.standard;
0N/A
0N/Aimport javax.print.attribute.Attribute;
0N/Aimport javax.print.attribute.EnumSyntax;
0N/Aimport javax.print.attribute.PrintServiceAttribute;
0N/A
0N/A/**
0N/A * Class PrinterState is a printing attribute class, an enumeration, that
0N/A * identifies the current state of a printer. Class PrinterState defines
0N/A * standard printer state values. A Print Service implementation only needs
0N/A * to report those printer states which are appropriate for the particular
0N/A * implementation; it does not have to report every defined printer state. The
0N/A * {@link PrinterStateReasons PrinterStateReasons} attribute augments the
0N/A * PrinterState attribute to give more detailed information about the printer
0N/A * in given printer state.
0N/A * <P>
0N/A * <B>IPP Compatibility:</B> The category name returned by
0N/A * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
0N/A * integer value is the IPP enum value. The <code>toString()</code> method
0N/A * returns the IPP string representation of the attribute value.
0N/A * <P>
0N/A *
0N/A * @author Alan Kaminsky
0N/A */
0N/Apublic final class PrinterState extends EnumSyntax
0N/Aimplements PrintServiceAttribute {
0N/A
0N/A private static final long serialVersionUID = -649578618346507718L;
0N/A
0N/A /**
0N/A * The printer state is unknown.
0N/A */
0N/A public static final PrinterState UNKNOWN = new PrinterState(0);
0N/A
0N/A /**
0N/A * Indicates that new jobs can start processing without waiting.
0N/A */
0N/A public static final PrinterState IDLE = new PrinterState(3);
0N/A
0N/A /**
0N/A * Indicates that jobs are processing;
0N/A * new jobs will wait before processing.
0N/A */
0N/A public static final PrinterState PROCESSING = new PrinterState(4);
0N/A
0N/A /**
0N/A * Indicates that no jobs can be processed and intervention is required.
0N/A */
0N/A public static final PrinterState STOPPED = new PrinterState(5);
0N/A
0N/A /**
0N/A * Construct a new printer state enumeration value with the given integer
0N/A * value.
0N/A *
0N/A * @param value Integer value.
0N/A */
0N/A protected PrinterState(int value) {
0N/A super (value);
0N/A }
0N/A
0N/A private static final String[] myStringTable = {
0N/A "unknown",
0N/A null,
0N/A null,
0N/A "idle",
0N/A "processing",
0N/A "stopped"
0N/A };
0N/A
0N/A private static final PrinterState[] myEnumValueTable = {
0N/A UNKNOWN,
0N/A null,
0N/A null,
0N/A IDLE,
0N/A PROCESSING,
0N/A STOPPED
0N/A };
0N/A
0N/A /**
0N/A * Returns the string table for class PrinterState.
0N/A */
0N/A protected String[] getStringTable() {
0N/A return myStringTable;
0N/A }
0N/A
0N/A /**
0N/A * Returns the enumeration value table for class PrinterState.
0N/A */
0N/A protected EnumSyntax[] getEnumValueTable() {
0N/A return myEnumValueTable;
0N/A }
0N/A
0N/A /**
0N/A * Get the printing attribute class which is to be used as the "category"
0N/A * for this printing attribute value.
0N/A * <P>
0N/A * For class PrinterState, the category is class PrinterState itself.
0N/A *
0N/A * @return Printing attribute class (category), an instance of class
0N/A * {@link java.lang.Class java.lang.Class}.
0N/A */
0N/A public final Class<? extends Attribute> getCategory() {
0N/A return PrinterState.class;
0N/A }
0N/A
0N/A /**
0N/A * Get the name of the category of which this attribute value is an
0N/A * instance.
0N/A * <P>
0N/A * For class PrinterState, the category name is <CODE>"printer-state"</CODE>.
0N/A *
0N/A * @return Attribute category name.
0N/A */
0N/A public final String getName() {
0N/A return "printer-state";
0N/A }
0N/A
0N/A}