org.apache.commons.math3.linear

## Class RealVector.SparseEntryIterator

- java.lang.Object
- - org.apache.commons.math3.linear.RealVector.SparseEntryIterator

All Implemented Interfaces:
  Iterator<RealVector.Entry>

Enclosing class:
  RealVector

Deprecated.
As of 3.1, this class is deprecated, see JIRA MATH-875. This class will be completely removed in 4.0.

    @Deprecated
    protected class RealVector.SparseEntryIterator
    extends Object
    implements Iterator<RealVector.Entry>

This class should rarely be used, but is here to provide a default implementation of sparseIterator(), which is implemented by walking over the entries, skipping those whose values are the default one. Concrete subclasses which are SparseVector implementations should make their own sparse iterator, rather than using this one. This implementation might be useful for ArrayRealVector, when expensive operations which preserve the default value are to be done on the entries, and the fraction of non-default values is small (i.e. someone took a SparseVector, and passed it into the copy-constructor of ArrayRealVector)

### Field Summary

Fields
`private RealVector.Entry` `current` Deprecated. Last entry returned by `next()`.
`private int` `dim` Deprecated. Dimension of the vector.
`private RealVector.Entry` `next` Deprecated. Next entry for `next()` to return.

### Constructor Summary

Constructors
`protected` `RealVector.SparseEntryIterator()` Deprecated. Simple constructor.

### Method Summary

Methods
`protected void` `advance(RealVector.Entry e)` Deprecated. Advance an entry up to the next nonzero one.
`boolean` `hasNext()` Deprecated.
`RealVector.Entry` `next()` Deprecated.
`void` `remove()` Deprecated.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### dim

    private final int dim

Deprecated.
Dimension of the vector.

#### current

    private RealVector.Entry current

Deprecated.
Last entry returned by `next()`.

#### next

    private RealVector.Entry next

Deprecated.
Next entry for `next()` to return.

### Constructor Detail

#### RealVector.SparseEntryIterator

    protected RealVector.SparseEntryIterator()

Deprecated.
Simple constructor.

### Method Detail

#### advance

    protected void advance(RealVector.Entry e)

Deprecated.
Advance an entry up to the next nonzero one.

Parameters:
  `e` - entry to advance.

#### hasNext

    public boolean hasNext()

Deprecated.

Specified by:
  `hasNext` in interface `Iterator<RealVector.Entry>`

#### next

    public RealVector.Entry next()

Deprecated.

Specified by:
  `next` in interface `Iterator<RealVector.Entry>`

#### remove

    public void remove()
                throws MathUnsupportedOperationException

Deprecated.

Specified by:
  `remove` in interface `Iterator<RealVector.Entry>`
Throws:
  `MathUnsupportedOperationException` - in all circumstances.