SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse
Class SparseVector.Iterator

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.SparseVector.Iterator
All Implemented Interfaces:
java.util.Iterator<SparseVector.Entry>
Enclosing class:
SparseVector

public static class SparseVector.Iterator
extends java.lang.Object
implements java.util.Iterator<SparseVector.Entry>

This wrapper class overrides the Iterator.remove() method for throwing exception when it is called.


Method Summary
 boolean hasNext()
           
 SparseVector.Entry next()
           
 void remove()
          Overriden to avoid the vector being altered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<SparseVector.Entry>

next

public SparseVector.Entry next()
Specified by:
next in interface java.util.Iterator<SparseVector.Entry>

remove

public void remove()
Overriden to avoid the vector being altered.

Specified by:
remove in interface java.util.Iterator<SparseVector.Entry>
Throws:
java.lang.UnsupportedOperationException - always; set the element to zero instead

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.