Package net.i2p.router.util
Class CachedIteratorCollection<E>
java.lang.Object
java.util.AbstractCollection<E>
net.i2p.router.util.CachedIteratorCollection<E>
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
public class CachedIteratorCollection<E> extends AbstractCollection<E>
Extend java.util.AbstractCollection to create a collection that can be
iterated over without creation of a new object
- Since:
- 0.9.36
-
Constructor Summary
Constructors Constructor Description CachedIteratorCollection()
Default constructor -
Method Summary
Modifier and Type Method Description boolean
add(E element)
Adds a data object (element) as a Node and sets previous/next pointers accordinglyvoid
clear()
Clears the AbstractCollectionTest object, all pointers reset to 'null'Iterator<E>
iterator()
Iterator: Resets and returns CachedIteratorint
size()
Return size of current LinkedListTest objectMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
CachedIteratorCollection
public CachedIteratorCollection()Default constructor
-
-
Method Details
-
add
Adds a data object (element) as a Node and sets previous/next pointers accordingly- Specified by:
add
in interfaceCollection<E>
- Overrides:
add
in classAbstractCollection<E>
-
clear
public void clear()Clears the AbstractCollectionTest object, all pointers reset to 'null'- Specified by:
clear
in interfaceCollection<E>
- Overrides:
clear
in classAbstractCollection<E>
-
iterator
Iterator: Resets and returns CachedIterator- Specified by:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Specified by:
iterator
in classAbstractCollection<E>
-
size
public int size()Return size of current LinkedListTest object- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in classAbstractCollection<E>
-