1. /*
  2. * @(#)HashPrintRequestAttributeSet.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 HashPrintRequestAttributeSet inherits its implementation from
  11. * class {@link HashAttributeSet HashAttributeSet} and enforces the
  12. * semantic restrictions of interface
  13. * {@link PrintRequestAttributeSet PrintRequestAttributeSet}.
  14. * <P>
  15. *
  16. * @author Alan Kaminsky
  17. */
  18. public class HashPrintRequestAttributeSet extends HashAttributeSet
  19. implements PrintRequestAttributeSet, Serializable {
  20. /**
  21. * Construct a new, empty print request attribute set.
  22. */
  23. public HashPrintRequestAttributeSet() {
  24. super (PrintRequestAttribute.class);
  25. }
  26. /**
  27. * Construct a new print request 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 HashPrintRequestAttributeSet(PrintRequestAttribute attribute) {
  36. super (attribute, PrintRequestAttribute.class);
  37. }
  38. /**
  39. * Construct a new print request attribute set, initially populated with
  40. * the values from the given array. The new attribute set is populated
  41. * by adding the elements of <CODE>attributes</CODE> array to the set in
  42. * sequence, starting at index 0. Thus, later array elements may replace
  43. * earlier array elements if the array contains duplicate attribute
  44. * values or attribute categories.
  45. *
  46. * @param attributes Array of attribute values to add to the set.
  47. * If null, an empty attribute set is constructed.
  48. *
  49. * @exception NullPointerException
  50. * (unchecked exception)
  51. * Thrown if any element of <CODE>attributes</CODE> is null.
  52. */
  53. public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes) {
  54. super (attributes, PrintRequestAttribute.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>(PrintRequestAttributeSe</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>(PrintRequestAttributeSe</CODE>.
  68. */
  69. public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
  70. {
  71. super(attributes, PrintRequestAttribute.class);
  72. }
  73. }