Class SparseArray.NonzeroView<N extends Comparable<N>>
java.lang.Object
org.ojalgo.array.SparseArray.NonzeroView<N>
- All Implemented Interfaces:
Comparable<SparseArray.NonzeroView<N>>, Iterable<SparseArray.NonzeroView<N>>, Iterator<SparseArray.NonzeroView<N>>, Spliterator<SparseArray.NonzeroView<N>>, AccessScalar<N>, ElementView1D<N, SparseArray.NonzeroView<N>>, NumberDefinition
- Enclosing class:
SparseArray<N extends Comparable<N>>
public static final class SparseArray.NonzeroView<N extends Comparable<N>>
extends Object
implements ElementView1D<N, SparseArray.NonzeroView<N>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final int[]private final intprivate final DenseArray<N> Fields inherited from interface ElementView1D
CHARACTERISTICSFields inherited from interface Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)NonzeroView(int[] indices, DenseArray<N> values, int actualLength) privateNonzeroView(int[] indices, DenseArray<N> values, int initial, int last) -
Method Summary
Modifier and TypeMethodDescriptiondoublelongvoidforEachRemaining(Consumer<? super SparseArray.NonzeroView<N>> action) get()booleanhasNext()booleanlongindex()iterator()voidmodify(double left, BinaryFunction<N> function) voidmodify(N left, BinaryFunction<N> function) voidmodify(BinaryFunction<N> function, double right) voidmodify(BinaryFunction<N> function, N right) next()longprevious()longbooleantryAdvance(Consumer<? super SparseArray.NonzeroView<N>> action) trySplit()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ElementView1D
characteristics, compareTo, getComparator, remove, step, streamMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface NumberDefinition
booleanValue, byteValue, floatValue, intValue, longValue, shortValueMethods inherited from interface Spliterator
getExactSizeIfKnown, hasCharacteristics
-
Field Details
-
myCursor
private int myCursor -
myIndices
private final int[] myIndices -
myLastCursor
private final int myLastCursor -
myValues
-
-
Constructor Details
-
NonzeroView
-
NonzeroView
NonzeroView(int[] indices, DenseArray<N> values, int actualLength)
-
-
Method Details
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein interfaceNumberDefinition
-
estimateSize
public long estimateSize()- Specified by:
estimateSizein interfaceSpliterator<N extends Comparable<N>>
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>- Specified by:
forEachRemainingin interfaceIterator<N extends Comparable<N>>- Specified by:
forEachRemainingin interfaceSpliterator<N extends Comparable<N>>
-
get
- Specified by:
getin interfaceAccessScalar<N extends Comparable<N>>
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<N extends Comparable<N>>
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>
-
index
public long index()- Specified by:
indexin interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>
-
iterator
- Specified by:
iteratorin interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>- Specified by:
iteratorin interfaceIterable<N extends Comparable<N>>
-
modify
-
modify
-
modify
-
modify
-
next
- Specified by:
nextin interfaceIterator<N extends Comparable<N>>
-
nextIndex
public long nextIndex()- Specified by:
nextIndexin interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>
-
previous
- Specified by:
previousin interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>
-
previousIndex
public long previousIndex()- Specified by:
previousIndexin interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>
-
tryAdvance
- Specified by:
tryAdvancein interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>- Specified by:
tryAdvancein interfaceSpliterator<N extends Comparable<N>>
-
trySplit
- Specified by:
trySplitin interfaceElementView1D<N extends Comparable<N>, SparseArray.NonzeroView<N extends Comparable<N>>>- Specified by:
trySplitin interfaceSpliterator<N extends Comparable<N>>
-