1. /*
  2. * @(#)HashPrintServiceAttributeSet.java 1.5 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 HashPrintServiceAttributeSet provides an attribute set
  11. * which inherits its implementation from class {@link HashAttributeSet
  12. * HashAttributeSet} and enforces the semantic restrictions of interface
  13. * {@link PrintServiceAttributeSet PrintServiceAttributeSet}.
  14. * <P>
  15. *
  16. * @author Alan Kaminsky
  17. */
  18. public class HashPrintServiceAttributeSet extends HashAttributeSet
  19. implements PrintServiceAttributeSet, Serializable {
  20. /**
  21. * Construct a new, empty hash print service attribute set.
  22. */
  23. public HashPrintServiceAttributeSet() {
  24. super (PrintServiceAttribute.class);
  25. }
  26. /**
  27. * Construct a new hash print service 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 HashPrintServiceAttributeSet(PrintServiceAttribute attribute) {
  36. super (attribute, PrintServiceAttribute.class);
  37. }
  38. /**
  39. * Construct a new print service 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 HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes) {
  54. super (attributes, PrintServiceAttribute.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>PrintServiceAttribute</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>PrintServiceAttribute</CODE>.
  68. */
  69. public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes)
  70. {
  71. super(attributes, PrintServiceAttribute.class);
  72. }
  73. }