Package com.gengoai.collection
Class IteratorSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- com.gengoai.collection.IteratorSet<E>
-
- Type Parameters:
E
- the type parameter
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
public class IteratorSet<E> extends AbstractSet<E>
A Set implementation backed by an iterator.
- Author:
- David B. Bracewell
-
-
Constructor Summary
Constructors Constructor Description IteratorSet(Supplier<Iterator<E>> iteratorSupplier)
Instantiates a new Iterator set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Iterator<E>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
removeIf(Predicate<? super E> filter)
int
size()
String
toString()
-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
add, addAll, contains, containsAll, isEmpty, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.Set
add, addAll, contains, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceSet<E>
- Overrides:
clear
in classAbstractCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<E>
- Specified by:
remove
in interfaceSet<E>
- Overrides:
remove
in classAbstractCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<E>
- Specified by:
removeAll
in interfaceSet<E>
- Overrides:
removeAll
in classAbstractSet<E>
-
size
public int size()
- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceSet<E>
- Specified by:
size
in classAbstractCollection<E>
-
toString
public String toString()
- Overrides:
toString
in classAbstractCollection<E>
-
-