1. /*
  2. * @(#)HashPrintJobAttributeSet.java 1.6 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. package javax.print.attribute;
  8. import java.io.Serializable;
  9. /**
  10. * Class HashPrintJobAttributeSet provides an attribute set
  11. * which inherits its implementation from class {@link HashAttributeSet
  12. * HashAttributeSet} and enforces the semantic restrictions of interface
  13. * {@link PrintJobAttributeSet PrintJobAttributeSet}.
  14. * <P>
  15. *
  16. * @author Alan Kaminsky
  17. */
  18. public class HashPrintJobAttributeSet extends HashAttributeSet
  19. implements PrintJobAttributeSet, Serializable {
  20. private static final long serialVersionUID = -4204473656070350348L;
  21. /**
  22. * Construct a new, empty hash print job attribute set.
  23. */
  24. public HashPrintJobAttributeSet() {
  25. super(PrintJobAttribute.class);
  26. }
  27. /**
  28. * Construct a new hash print job attribute set,
  29. * initially populated with the given value.
  30. *
  31. * @param attribute Attribute value to add to the set.
  32. *
  33. * @exception NullPointerException
  34. * (unchecked exception) Thrown if <CODE>attribute</CODE> is null.
  35. */
  36. public HashPrintJobAttributeSet(PrintJobAttribute attribute) {
  37. super(attribute, PrintJobAttribute.class);
  38. }
  39. /**
  40. * Construct a new hash print job attribute set,
  41. * initially populated with the values from the given array.
  42. * The new attribute set is populated
  43. * by adding the elements of <CODE>attributes</CODE> array to the set in
  44. * sequence, starting at index 0. Thus, later array elements may replace
  45. * earlier array elements if the array contains duplicate attribute
  46. * values or attribute categories.
  47. *
  48. * @param attributes Array of attribute values to add to the set.
  49. * If null, an empty attribute set is constructed.
  50. *
  51. * @exception NullPointerException (unchecked exception)
  52. * Thrown if any element of <CODE>attributes</CODE> is null.
  53. */
  54. public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) {
  55. super (attributes, PrintJobAttribute.class);
  56. }
  57. /**
  58. * Construct a new attribute set, initially populated with the
  59. * values from the given set where the members of the attribute set
  60. * are restricted to the <code>PrintJobAttribute</code> interface.
  61. *
  62. * @param attributes set of attribute values to initialise the set. If
  63. * null, an empty attribute set is constructed.
  64. *
  65. * @exception ClassCastException
  66. * (unchecked exception) Thrown if any element of
  67. * <CODE>attributes</CODE> is not an instance of
  68. * <CODE>PrintJobAttribute</CODE>.
  69. */
  70. public HashPrintJobAttributeSet(PrintJobAttributeSet attributes) {
  71. super(attributes, PrintJobAttribute.class);
  72. }
  73. }