Package org.apache.sis.util.collection
Class FrequencySortedSet.Iter
java.lang.Object
org.apache.sis.util.collection.FrequencySortedSet.Iter
- All Implemented Interfaces:
Iterator<E>
- Enclosing class:
- FrequencySortedSet<E>
Iterator over sorted elements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final E[]
A copy ofFrequencySortedSet.sorted
at the time this iterator has been created.private int
Index of the next element to return.private final int
Index of the first element (lower
) and index after the last element (upper
) on which to iterate.private final int
Index of the first element (lower
) and index after the last element (upper
) on which to iterate. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
elements
A copy ofFrequencySortedSet.sorted
at the time this iterator has been created. Used because thesorted
array is set tonull
whenremove()
is invoked. -
lower
private final int lowerIndex of the first element (lower
) and index after the last element (upper
) on which to iterate. -
upper
private final int upperIndex of the first element (lower
) and index after the last element (upper
) on which to iterate. -
index
private int indexIndex of the next element to return.
-
-
Constructor Details
-
Iter
Iter(E[] sorted, int lower, int upper) Creates an new iterator.
-
-
Method Details
-
hasNext
public boolean hasNext()Returnstrue
if there is more elements to return. -
next
Return the next element. -
remove
public void remove()Remove the last elements returned bynext()
.
-