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

alluxio.collections.DelegatingSet Maven / Gradle / Ivy

There is a newer version: 313
Show newest version
/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.collections;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import java.util.Spliterator;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Stream;

/**
 * A set which delegates all methods to another set.
 *
 * @param  the type of element stored in the set
 */
public class DelegatingSet implements Set {
  private final Set mDelegate;

  /**
   * @param delegate the delegate to delegate to
   */
  public DelegatingSet(Set delegate) {
    mDelegate = delegate;
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @Override
  public Spliterator spliterator() {
    return mDelegate.spliterator();
  }

  @Override
  public boolean removeIf(Predicate filter) {
    return mDelegate.removeIf(filter);
  }

  @Override
  public Stream stream() {
    return mDelegate.stream();
  }

  @Override
  public Stream parallelStream() {
    return mDelegate.parallelStream();
  }

  @Override
  public void forEach(Consumer action) {
    mDelegate.forEach(action);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy