1. /*
  2. * @(#)MutableAttributeSet.java 1.15 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.swing.text;
  8. import java.util.Enumeration;
  9. /**
  10. * A generic interface for a mutable collection of unique attributes.
  11. *
  12. * Implementations will probably want to provide a constructor of the
  13. * form:<tt>
  14. * public XXXAttributeSet(ConstAttributeSet source);</tt>
  15. *
  16. * @version 1.15 01/23/03
  17. */
  18. public interface MutableAttributeSet extends AttributeSet {
  19. /**
  20. * Creates a new attribute set similar to this one except that it contains
  21. * an attribute with the given name and value. The object must be
  22. * immutable, or not mutated by any client.
  23. *
  24. * @param name the name
  25. * @param value the value
  26. */
  27. public void addAttribute(Object name, Object value);
  28. /**
  29. * Creates a new attribute set similar to this one except that it contains
  30. * the given attributes and values.
  31. *
  32. * @param attributes the set of attributes
  33. */
  34. public void addAttributes(AttributeSet attributes);
  35. /**
  36. * Removes an attribute with the given <code>name</code>.
  37. *
  38. * @param name the attribute name
  39. */
  40. public void removeAttribute(Object name);
  41. /**
  42. * Removes an attribute set with the given <code>names</code>.
  43. *
  44. * @param names the set of names
  45. */
  46. public void removeAttributes(Enumeration names);
  47. /**
  48. * Removes a set of attributes with the given <code>name</code>.
  49. *
  50. * @param attributes the set of attributes
  51. */
  52. public void removeAttributes(AttributeSet attributes);
  53. /**
  54. * Sets the resolving parent. This is the set
  55. * of attributes to resolve through if an attribute
  56. * isn't defined locally.
  57. *
  58. * @param parent the parent
  59. */
  60. public void setResolveParent(AttributeSet parent);
  61. }