jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2000-2004 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package javax.print.attribute.standard;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.net.URI;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.print.attribute.Attribute;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.print.attribute.URISyntax;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import javax.print.attribute.PrintServiceAttribute;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * Class PrinterMoreInfoManufacturer is a printing attribute class, a URI,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * that is used to obtain more information about this type of device.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * The information obtained from this URI is intended for end user
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * consumption. Features outside the scope of the Print Service API
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * can be accessed from this URI (e.g.,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * latest firmware, upgrades, service proxies, optional features available,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * details on color support). The information is intended to be germane to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * this kind of printer without regard to site specific modifications or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * services.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <P
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * to find out more information about this specific printer rather than this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * general kind of printer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <B>IPP Compatibility:</B> The string form returned by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <CODE>toString()</CODE> gives the IPP uri value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * The category name returned by <CODE>getName()</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * gives the IPP attribute name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
public final class PrinterMoreInfoManufacturer extends URISyntax
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        implements PrintServiceAttribute {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    private static final long serialVersionUID = 3323271346485076608L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * Constructs a new printer more info manufacturer attribute with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * specified URI.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * @param  uri  URI.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     *     (unchecked exception) Thrown if <CODE>uri</CODE> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    public PrinterMoreInfoManufacturer(URI uri) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        super (uri);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * Returns whether this printer more info manufacturer attribute is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * equivalent to the passed in object. To be equivalent, all of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * following conditions must be true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * <OL TYPE=1>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * <CODE>object</CODE> is not null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * <CODE>object</CODE> is an instance of class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * PrinterMoreInfoManufacturer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * This printer more info manufacturer attribute's URI and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * <CODE>object</CODE>'s URI are equal.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * </OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @param  object  Object to compare to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * @return  True if <CODE>object</CODE> is equivalent to this printer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     *          more info manufacturer attribute, false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    public boolean equals(Object object) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        return (super.equals(object) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                object instanceof PrinterMoreInfoManufacturer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * Get the printing attribute class which is to be used as the "category"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * for this printing attribute value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * For class PrinterMoreInfoManufacturer, the category is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * class PrinterMoreInfoManufacturer itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @return  Printing attribute class (category), an instance of class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     *          {@link java.lang.Class java.lang.Class}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    public final Class<? extends Attribute> getCategory() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        return PrinterMoreInfoManufacturer.class;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * Get the name of the category of which this attribute value is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * For class PrinterMoreInfoManufacturer, the category name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * <CODE>"printer-more-info-manufacturer"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @return  Attribute category name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    public final String getName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        return "printer-more-info-manufacturer";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
}