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

org.infinispan.commons.util.CloseableIteratorCollectionAdapter Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.commons.util;

import java.util.Collection;

/**
 * Adapts {@link java.util.Collection} to {@link CloseableIteratorCollection}
 *
 * @author Radim Vansa <[email protected]>
 */
public class CloseableIteratorCollectionAdapter implements CloseableIteratorCollection {
   protected final Collection delegate;

   public CloseableIteratorCollectionAdapter(Collection delegate) {
      this.delegate = delegate;
   }

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

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

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

   @Override
   public CloseableIterator iterator() {
      return Closeables.iterator(delegate.iterator());
   }

   @Override
   public CloseableSpliterator spliterator() {
      return Closeables.spliterator(delegate.spliterator());
   }

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

   @Override
   public  T[] toArray(T[] a) {
      return delegate.toArray(a);
   }

   @Override
   public boolean add(E e) {
      return delegate.add(e);
   }

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy