1. /*
  2. * Copyright 2003-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.apache.commons.collections.set;
  17. import java.util.Set;
  18. import org.apache.commons.collections.collection.AbstractCollectionDecorator;
  19. /**
  20. * Decorates another <code>Set</code> to provide additional behaviour.
  21. * <p>
  22. * Methods are forwarded directly to the decorated set.
  23. *
  24. * @since Commons Collections 3.0
  25. * @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:03 $
  26. *
  27. * @author Stephen Colebourne
  28. */
  29. public abstract class AbstractSetDecorator extends AbstractCollectionDecorator implements Set {
  30. /**
  31. * Constructor only used in deserialization, do not use otherwise.
  32. * @since Commons Collections 3.1
  33. */
  34. protected AbstractSetDecorator() {
  35. super();
  36. }
  37. /**
  38. * Constructor that wraps (not copies).
  39. *
  40. * @param set the set to decorate, must not be null
  41. * @throws IllegalArgumentException if set is null
  42. */
  43. protected AbstractSetDecorator(Set set) {
  44. super(set);
  45. }
  46. /**
  47. * Gets the set being decorated.
  48. *
  49. * @return the decorated set
  50. */
  51. protected Set getSet() {
  52. return (Set) getCollection();
  53. }
  54. }