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.sortedat the time this iterator has been created.private intIndex of the next element to return.private final intIndex of the first element (lower) and index after the last element (upper) on which to iterate.private final intIndex 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, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
elements
A copy ofFrequencySortedSet.sortedat the time this iterator has been created. Used because thesortedarray is set tonullwhenremove()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()Returnstrueif there is more elements to return. -
next
Return the next element. -
remove
public void remove()Remove the last elements returned bynext().
-