1. /*
  2. * @(#)HashPrintJobAttributeSet.java 1.4 03/01/23
  3. *
  4. * Copyright 2003 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. /**
  21. * Construct a new, empty hash print job attribute set.
  22. */
  23. public HashPrintJobAttributeSet() {
  24. super(PrintJobAttribute.class);
  25. }
  26. /**
  27. * Construct a new hash print job attribute set,
  28. * initially populated with the given value.
  29. *
  30. * @param attribute Attribute value to add to the set.
  31. *
  32. * @exception NullPointerException
  33. * (unchecked exception) Thrown if <CODE>attribute</CODE> is null.
  34. */
  35. public HashPrintJobAttributeSet(PrintJobAttribute attribute) {
  36. super(attribute, PrintJobAttribute.class);
  37. }
  38. /**
  39. * Construct a new hash print job attribute set,
  40. * initially populated with the values from the given array.
  41. * The new attribute set is populated
  42. * by adding the elements of <CODE>attributes</CODE> array to the set in
  43. * sequence, starting at index 0. Thus, later array elements may replace
  44. * earlier array elements if the array contains duplicate attribute
  45. * values or attribute categories.
  46. *
  47. * @param attributes Array of attribute values to add to the set.
  48. * If null, an empty attribute set is constructed.
  49. *
  50. * @exception NullPointerException (unchecked exception)
  51. * Thrown if any element of <CODE>attributes</CODE> is null.
  52. */
  53. public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) {
  54. super (attributes, PrintJobAttribute.class);
  55. }
  56. /**
  57. * Construct a new attribute set, initially populated with the
  58. * values from the given set where the members of the attribute set
  59. * are restricted to the <code>PrintJobAttribute</code> interface.
  60. *
  61. * @param attributes set of attribute values to initialise the set. If
  62. * null, an empty attribute set is constructed.
  63. *
  64. * @exception ClassCastException
  65. * (unchecked exception) Thrown if any element of
  66. * <CODE>attributes</CODE> is not an instance of
  67. * <CODE>PrintJobAttribute</CODE>.
  68. */
  69. public HashPrintJobAttributeSet(PrintJobAttributeSet attributes) {
  70. super(attributes, PrintJobAttribute.class);
  71. }
  72. }