net.dongliu.commons.collection.ForwardingCollection Maven / Gradle / Ivy
The newest version!
package net.dongliu.commons.collection;
import java.util.Collection;
import java.util.Iterator;
import java.util.function.Predicate;
/**
* EnhancedCollection
*
* @author Liu Dong
*/
class ForwardingCollection implements ExCollection {
private final Collection collection;
ForwardingCollection(Collection collection) {
this.collection = collection;
}
@Override
public int hashCode() {
return collection.hashCode();
}
@Override
public int size() {
return collection.size();
}
@Override
public boolean isEmpty() {
return collection.isEmpty();
}
@Override
public boolean contains(Object o) {
return collection.contains(o);
}
@Override
public Iterator iterator() {
return collection.iterator();
}
@Override
public Object[] toArray() {
return collection.toArray();
}
@Override
public T1[] toArray(T1[] a) {
return collection.toArray(a);
}
@Override
public boolean add(T t) {
return collection.add(t);
}
@Override
public boolean remove(Object o) {
return collection.remove(o);
}
@Override
public boolean containsAll(Collection> c) {
return collection.containsAll(c);
}
@Override
public boolean addAll(Collection extends T> c) {
return collection.addAll(c);
}
@Override
public boolean removeAll(Collection> c) {
return collection.removeAll(c);
}
@Override
public boolean removeIf(Predicate super T> filter) {
return collection.removeIf(filter);
}
@Override
public boolean retainAll(Collection> c) {
return collection.retainAll(c);
}
@Override
public void clear() {
collection.clear();
}
@Override
public boolean equals(Object o) {
return collection.equals(o);
}
}