KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > PrinterMoreInfo


1 /*
2  * @(#)PrinterMoreInfo.java 1.8 04/05/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.print.attribute.standard;
8
9 import java.net.URI JavaDoc;
10
11 import javax.print.attribute.Attribute JavaDoc;
12 import javax.print.attribute.URISyntax JavaDoc;
13 import javax.print.attribute.PrintServiceAttribute JavaDoc;
14
15 /**
16  * Class PrinterMoreInfo is a printing attribute class, a URI, that is used to
17  * obtain more information about this specific printer. For example, this
18  * could be an HTTP type URI referencing an HTML page accessible to a web
19  * browser. The information obtained from this URI is intended for end user
20  * consumption. Features outside the scope of the Print Service API can be
21  * accessed from this URI.
22  * The information is intended to be specific to this printer instance and
23  * site specific services (e.g. job pricing, services offered, end user
24  * assistance).
25  * <P>
26  * In contrast, the {@link PrinterMoreInfoManufacturer
27  * PrinterMoreInfoManufacturer} attribute is used to find out more information
28  * about this general kind of printer rather than this specific printer.
29  * <P>
30  * <B>IPP Compatibility:</B> The string form returned by
31  * <CODE>toString()</CODE> gives the IPP uri value.
32  * The category name returned by <CODE>getName()</CODE>
33  * gives the IPP attribute name.
34  * <P>
35  *
36  * @author Alan Kaminsky
37  */

38 public final class PrinterMoreInfo extends URISyntax JavaDoc
39     implements PrintServiceAttribute JavaDoc {
40
41     private static final long serialVersionUID = 4555850007675338574L;
42
43     /**
44      * Constructs a new printer more info attribute with the specified URI.
45      *
46      * @param uri URI.
47      *
48      * @exception NullPointerException
49      * (unchecked exception) Thrown if <CODE>uri</CODE> is null.
50      */

51     public PrinterMoreInfo(URI JavaDoc uri) {
52     super (uri);
53     }
54
55     /**
56      * Returns whether this printer more info attribute is equivalent to the
57      * passed in object. To be equivalent, all of the following conditions
58      * must be true:
59      * <OL TYPE=1>
60      * <LI>
61      * <CODE>object</CODE> is not null.
62      * <LI>
63      * <CODE>object</CODE> is an instance of class PrinterMoreInfo.
64      * <LI>
65      * This printer more info attribute's URI and <CODE>object</CODE>'s URI
66      * are equal.
67      * </OL>
68      *
69      * @param object Object to compare to.
70      *
71      * @return True if <CODE>object</CODE> is equivalent to this printer
72      * more info attribute, false otherwise.
73      */

74     public boolean equals(Object JavaDoc object) {
75     return (super.equals(object) &&
76         object instanceof PrinterMoreInfo JavaDoc);
77     }
78
79     /**
80      * Get the printing attribute class which is to be used as the "category"
81      * for this printing attribute value.
82      * <P>
83      * For class PrinterMoreInfo, the category is class PrinterMoreInfo itself.
84      *
85      * @return Printing attribute class (category), an instance of class
86      * {@link java.lang.Class java.lang.Class}.
87      */

88     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
89     return PrinterMoreInfo JavaDoc.class;
90     }
91
92     /**
93      * Get the name of the category of which this attribute value is an
94      * instance.
95      * <P>
96      * For class PrinterMoreInfo, the
97      * category name is <CODE>"printer-more-info"</CODE>.
98      *
99      * @return Attribute category name.
100      */

101     public final String JavaDoc getName() {
102     return "printer-more-info";
103     }
104
105 }
106
Popular Tags