All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dongliu.commons.collection.ForwardingSet Maven / Gradle / Ivy

The newest version!
package net.dongliu.commons.collection;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;

/**
 * Set proxy operations to it's inner set
 *
 * @author Liu Dong
 */
class ForwardingSet implements ExSet {
    private final Set set;

    ForwardingSet(Set set) {
        this.set = set;
    }

    @Override
    public int size() {
        return set.size();
    }

    @Override
    public boolean isEmpty() {
        return set.isEmpty();
    }

    @Override
    public boolean contains(Object o) {
        return set.contains(o);
    }

    @Override
    public Iterator iterator() {
        return set.iterator();
    }

    @Override
    public Object[] toArray() {
        return set.toArray();
    }

    @Override
    public  T1[] toArray(T1[] a) {
        return set.toArray(a);
    }

    @Override
    public boolean add(T t) {
        return set.add(t);
    }

    @Override
    public boolean remove(Object o) {
        return set.remove(o);
    }

    @Override
    public boolean containsAll(Collection c) {
        return set.containsAll(c);
    }

    @Override
    public boolean addAll(Collection c) {
        return set.addAll(c);
    }

    @Override
    public boolean retainAll(Collection c) {
        return set.retainAll(c);
    }

    @Override
    public boolean removeAll(Collection c) {
        return set.removeAll(c);
    }

    @Override
    public void clear() {
        set.clear();
    }

    @Override
    public boolean equals(Object o) {
        return set.equals(o);
    }

    @Override
    public int hashCode() {
        return set.hashCode();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy