SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.timeseries
Class TimeSeries.Iterator<E extends TimeSeries.Entry<?,?>>

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.timeseries.TimeSeries.Iterator<E>
Type Parameters:
E - a TimeSeries.Entry type
All Implemented Interfaces:
java.util.Iterator<E>
Direct Known Subclasses:
MultiVariateTimeSeries.Iterator, TimeSeries.Iterator
Enclosing interface:
TimeSeries<T,V>

public abstract static class TimeSeries.Iterator<E extends TimeSeries.Entry<?,?>>
extends java.lang.Object
implements java.util.Iterator<E>

the Iterator to read a time series

This class provides a default implementation of an Iterator for subclasses to override.


Field Summary
 int length
          the length of the time series
protected  int pos
          Convention: we advance pos before using, e.g., ++pos.
 TimeSeries<?,?> ts
          the time series to be iterated
 
Constructor Summary
TimeSeries.Iterator(TimeSeries<?,?> ts)
          Construct an iterator to read a time series.
 
Method Summary
 boolean hasNext()
           
abstract  E next()
          Get the next entry in the time series, if any.
 int position()
          Get the current position in reading the time series.
 void remove()
          Deprecated. a time series is immutable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ts

public final TimeSeries<?,?> ts
the time series to be iterated


length

public final int length
the length of the time series


pos

protected int pos
Convention: we advance pos before using, e.g., ++pos.

Constructor Detail

TimeSeries.Iterator

public TimeSeries.Iterator(TimeSeries<?,?> ts)
Construct an iterator to read a time series.

Parameters:
ts - a time series
Method Detail

next

public abstract E next()
Get the next entry in the time series, if any.

Specified by:
next in interface java.util.Iterator<E extends TimeSeries.Entry<?,?>>
Returns:
the next entry

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<E extends TimeSeries.Entry<?,?>>

position

public int position()
Get the current position in reading the time series.

Convention: pos initializes to 0 before being read.

Returns:
the current position

remove

@Deprecated
public void remove()
Deprecated. a time series is immutable

Specified by:
remove in interface java.util.Iterator<E extends TimeSeries.Entry<?,?>>

SuanShu, a Java numerical and statistical library

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