KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > HashPrintServiceAttributeSet


1 /*
2  * @(#)HashPrintServiceAttributeSet.java 1.7 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.print.attribute;
9
10 import java.io.Serializable JavaDoc;
11
12 /**
13  * Class HashPrintServiceAttributeSet provides an attribute set
14  * which inherits its implementation from class {@link HashAttributeSet
15  * HashAttributeSet} and enforces the semantic restrictions of interface
16  * {@link PrintServiceAttributeSet PrintServiceAttributeSet}.
17  * <P>
18  *
19  * @author Alan Kaminsky
20  */

21 public class HashPrintServiceAttributeSet extends HashAttributeSet JavaDoc
22     implements PrintServiceAttributeSet JavaDoc, Serializable JavaDoc {
23
24     private static final long serialVersionUID = 6642904616179203070L;
25
26     /**
27      * Construct a new, empty hash print service attribute set.
28      */

29     public HashPrintServiceAttributeSet() {
30     super (PrintServiceAttribute JavaDoc.class);
31     }
32
33   
34     /**
35      * Construct a new hash print service attribute set,
36      * initially populated with the given value.
37      *
38      * @param attribute Attribute value to add to the set.
39      *
40      * @exception NullPointerException
41      * (unchecked exception) Thrown if <CODE>attribute</CODE> is null.
42      */

43     public HashPrintServiceAttributeSet(PrintServiceAttribute JavaDoc attribute) {
44     super (attribute, PrintServiceAttribute JavaDoc.class);
45     }
46
47     /**
48      * Construct a new print service attribute set, initially populated with
49      * the values from the given array. The new attribute set is populated
50      * by adding the elements of <CODE>attributes</CODE> array to the set in
51      * sequence, starting at index 0. Thus, later array elements may replace
52      * earlier array elements if the array contains duplicate attribute
53      * values or attribute categories.
54      *
55      * @param attributes Array of attribute values to add to the set.
56      * If null, an empty attribute set is constructed.
57      *
58      * @exception NullPointerException
59      * (unchecked exception)
60      * Thrown if any element of <CODE>attributes</CODE> is null.
61      */

62     public HashPrintServiceAttributeSet(PrintServiceAttribute JavaDoc[] attributes) {
63     super (attributes, PrintServiceAttribute JavaDoc.class);
64     }
65
66
67     /**
68      * Construct a new attribute set, initially populated with the
69      * values from the given set where the members of the attribute set
70      * are restricted to the <code>PrintServiceAttribute</code> interface.
71      *
72      * @param attributes set of attribute values to initialise the set. If
73      * null, an empty attribute set is constructed.
74      *
75      * @exception ClassCastException
76      * (unchecked exception) Thrown if any element of
77      * <CODE>attributes</CODE> is not an instance of
78      * <CODE>PrintServiceAttribute</CODE>.
79      */

80     public HashPrintServiceAttributeSet(PrintServiceAttributeSet JavaDoc attributes)
81     {
82     super(attributes, PrintServiceAttribute JavaDoc.class);
83     }
84 }
85
Popular Tags