1 package org.jdiseq.filter;
2
3 import java.util.Set;
4 import java.util.HashSet;
5 import java.util.Collection;
6 import java.util.Iterator;
7
8 /***
9 * FilterSet containing the filter definitions.
10 */
11 public class FilterSet implements Set {
12
13 private Set delegateSet;
14
15 public FilterSet() {
16 delegateSet = new HashSet();
17 }
18
19 /*** {@inheritDoc} */
20 public boolean add(Object object) {
21 if (!(object instanceof Filter)) {
22 throw new IllegalArgumentException("FilterSet only accepts Filter object");
23 }
24 return delegateSet.add(object);
25 }
26
27 /***
28 * Typesafe adding of Filter object.
29 * @param filter object added to the set
30 * @return true if the object was added to the set
31 * @see java.util.Set#add(Object)
32 */
33 public boolean addFilter(Filter filter) {
34 return delegateSet.add(filter);
35 }
36
37 /*** {@inheritDoc} */
38 public boolean addAll(Collection collection) {
39 return delegateSet.addAll(collection);
40 }
41
42 /*** {@inheritDoc} */
43 public void clear() {
44 delegateSet.clear();
45 }
46
47 /*** {@inheritDoc} */
48 public boolean contains(Object object) {
49 return delegateSet.contains(object);
50 }
51
52 /*** {@inheritDoc} */
53 public boolean containsAll(Collection collection) {
54 return delegateSet.containsAll(collection);
55 }
56
57 /*** {@inheritDoc} */
58 public boolean isEmpty() {
59 return delegateSet.isEmpty();
60 }
61
62 /*** {@inheritDoc} */
63 public Iterator iterator() {
64 return delegateSet.iterator();
65 }
66
67 /*** {@inheritDoc} */
68 public boolean remove(Object o) {
69 return delegateSet.remove(o);
70 }
71
72 /*** {@inheritDoc} */
73 public boolean removeAll(Collection collection) {
74 return delegateSet.removeAll(collection);
75 }
76
77 /*** {@inheritDoc} */
78 public boolean retainAll(Collection collection) {
79 return delegateSet.retainAll(collection);
80 }
81
82 /*** {@inheritDoc} */
83 public int size() {
84 return delegateSet.size();
85 }
86
87 /*** {@inheritDoc} */
88 public Object[] toArray() {
89 return delegateSet.toArray();
90 }
91
92 /*** {@inheritDoc} */
93 public Object[] toArray(Object[] array) {
94 return delegateSet.toArray(array);
95 }
96 }
This page was automatically generated by Maven