Last active
September 19, 2015 20:52
-
-
Save lucastanziano/70dc3e268d0a7ebc3496 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ForwardingSet<E> implements Set<E> { | |
private final Set<E> s; | |
public ForwardingSet(Set<E> s) { | |
this.s = s; | |
} | |
public void clear() { | |
s.clear(); | |
} | |
public boolean contains(Object o) { | |
return s.contains(o); | |
} | |
public boolean isEmpty() { | |
return s.isEmpty(); | |
} | |
public int size() { | |
return s.size(); | |
} | |
public Iterator<E> iterator() { | |
return s.iterator(); | |
} | |
public boolean add(E e) { | |
return s.add(e); | |
} | |
public boolean remove(Object o) { | |
return s.remove(o); | |
} | |
public boolean containsAll(Collection<?> c) { | |
return s.containsAll(c); | |
} | |
public boolean addAll(Collection<? extends E> c) { | |
return s.addAll(c); | |
} | |
public boolean removeAll(Collection<?> c) { | |
return s.removeAll(c); | |
} | |
public boolean retainAll(Collection<?> c) { | |
return s.retainAll(c); | |
} | |
public Object[] toArray() { | |
return s.toArray(); | |
} | |
public <T> T[] toArray(T[] a) { | |
return s.toArray(a); | |
} | |
@Override | |
public boolean equals(Object o) { | |
return s.equals(o); | |
} | |
@Override | |
public int hashCode() { | |
return s.hashCode(); | |
} | |
@Override | |
public String toString() { | |
return s.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment