Class SparseVector.Iterator
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.SparseVector.Iterator
-
- All Implemented Interfaces:
Iterator<SparseVector.Entry>
- Enclosing class:
- SparseVector
public static class SparseVector.Iterator extends Object implements Iterator<SparseVector.Entry>
This wrapper class overrides theIterator.remove()
method to throw an exception when called.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
SparseVector.Entry
next()
void
remove()
Overridden to avoid the vector being altered.-
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
-
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<SparseVector.Entry>
-
next
public SparseVector.Entry next()
- Specified by:
next
in interfaceIterator<SparseVector.Entry>
-
remove
public void remove()
Overridden to avoid the vector being altered.- Specified by:
remove
in interfaceIterator<SparseVector.Entry>
- Throws:
UnsupportedOperationException
- always; set the element to zero instead
-
-