Class BoundedList.BoundedIterator
- java.lang.Object
-
- org.openjdk.jmc.common.collection.BoundedList.BoundedIterator
-
- All Implemented Interfaces:
java.lang.Iterable<T>
,java.util.Iterator<T>
- Enclosing class:
- BoundedList<T>
private class BoundedList.BoundedIterator extends java.lang.Object implements java.util.Iterator<T>, java.lang.Iterable<T>
The actual iterator. We assume that an iterator instance will not be shared between threads and that elements will not be added to the list after the iterator is created.
-
-
Field Summary
Fields Modifier and Type Field Description private BoundedList.INode<T>
current
private BoundedList.INode<T>
last
private int
size
-
Constructor Summary
Constructors Constructor Description BoundedIterator(int size, BoundedList.INode<T> first, BoundedList.INode<T> last)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
java.util.Iterator<T>
iterator()
T
next()
void
remove()
java.lang.String
toString()
-
-
-
Field Detail
-
size
private final int size
-
current
private BoundedList.INode<T> current
-
last
private final BoundedList.INode<T> last
-
-
Constructor Detail
-
BoundedIterator
BoundedIterator(int size, BoundedList.INode<T> first, BoundedList.INode<T> last)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-