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>
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a data object (element) as a Node and sets previous/next pointers accordinglyvoidclear()Clears the AbstractCollectionTest object, all pointers reset to 'null'iterator()Iterator: Resets and returns CachedIteratorintsize()Return size of current LinkedListTest objectMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
addin interfaceCollection<E>- Overrides:
addin classAbstractCollection<E>
-
clear
public void clear()Clears the AbstractCollectionTest object, all pointers reset to 'null'- Specified by:
clearin interfaceCollection<E>- Overrides:
clearin classAbstractCollection<E>
-
iterator
Iterator: Resets and returns CachedIterator- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin classAbstractCollection<E>
-
size
public int size()Return size of current LinkedListTest object- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein classAbstractCollection<E>
-