Module org.apache.jena.core
Package org.apache.jena.mem2.iterator
Class SparseArrayIndexedIterator<E>
java.lang.Object
org.apache.jena.util.iterator.NiceIterator<FastHashSet.IndexedKey<E>>
org.apache.jena.mem2.iterator.SparseArrayIndexedIterator<E>
- Type Parameters:
E- the type of the array elements
- All Implemented Interfaces:
Iterator<FastHashSet.IndexedKey<E>>,org.apache.jena.atlas.iterator.IteratorCloseable<FastHashSet.IndexedKey<E>>,org.apache.jena.atlas.lib.Closeable,ClosableIterator<FastHashSet.IndexedKey<E>>,ExtendedIterator<FastHashSet.IndexedKey<E>>
public class SparseArrayIndexedIterator<E>
extends NiceIterator<FastHashSet.IndexedKey<E>>
implements Iterator<FastHashSet.IndexedKey<E>>
An iterator over a sparse array, that skips null entries.
This iterator returns elements as
FastHashSet.IndexedKey objects,
which contain both the index and the value of the element.
The iterator works in ascending order, starting from index 0 up to the specified exclusive index.
This iterator will check for concurrent modifications by invoking a Runnable-
Constructor Summary
ConstructorsConstructorDescriptionSparseArrayIndexedIterator(E[] entries, int toIndexExclusive, Runnable checkForConcurrentModification) SparseArrayIndexedIterator(E[] entries, Runnable checkForConcurrentModification) -
Method Summary
Modifier and TypeMethodDescriptionvoidforEachRemaining(Consumer<? super FastHashSet.IndexedKey<E>> action) booleanhasNext()Returnstrueif the iteration has more elements.next()Returns the next element in the iteration.Methods inherited from class org.apache.jena.util.iterator.NiceIterator
andThen, andThen, asList, asSet, close, close, emptyIterator, filterDrop, filterKeep, mapWith, remove, removeNext, toList, toSetMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.util.iterator.ExtendedIterator
forEach, nextOptional
-
Constructor Details
-
SparseArrayIndexedIterator
-
SparseArrayIndexedIterator
-
-
Method Details
-
hasNext
public boolean hasNext()Returnstrueif the iteration has more elements. (In other words, returnstrueifnext()would return an element rather than throwing an exception.)- Specified by:
hasNextin interfaceIterator<E>- Overrides:
hasNextin classNiceIterator<FastHashSet.IndexedKey<E>>- Returns:
trueif the iteration has more elements
-
next
Returns the next element in the iteration.- Specified by:
nextin interfaceIterator<E>- Overrides:
nextin classNiceIterator<FastHashSet.IndexedKey<E>>- Returns:
- the next element in the iteration
- Throws:
NoSuchElementException- if the iteration has no more elements
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceIterator<E>
-