edu.rit.numeric
Class Series

java.lang.Object
  extended by edu.rit.numeric.Series
All Implemented Interfaces:
Iterable<Double>
Direct Known Subclasses:
ArraySeries, ListSeries, TransformedSeries

public abstract class Series
extends Object
implements Iterable<Double>

Class Series is the abstract base class for a series of real values (type double).


Nested Class Summary
static class Series.RobustStats
          Class Series.RobustStats holds the median, mean absolute deviation, and quantiles of a Series.
static class Series.Stats
          Class Series.Stats holds the mean, variance, and standard deviation of a Series.
 
Constructor Summary
Series()
          Construct a new series.
 
Method Summary
 boolean isEmpty()
          Determine if this series is empty.
 Iterator<Double> iterator()
          Returns an iterator over the values in this series.
abstract  int length()
          Returns the number of values in this series.
 double maxX()
          Returns the maximum value in this series.
 double minX()
          Returns the minimum value in this series.
 void print()
          Print this series on the standard output.
 void print(PrintStream theStream)
          Print this series on the given print stream.
 void print(PrintWriter theWriter)
          Print this series on the given print writer.
 Series.RobustStats robustStats()
          Returns a RobustStats object containing robust statistics of this series.
 Series.Stats stats()
          Returns a Stats object containing statistics of this series.
abstract  double x(int i)
          Returns the given X value in this series.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Series

public Series()
Construct a new series.

Method Detail

length

public abstract int length()
Returns the number of values in this series.

Returns:
Length.

isEmpty

public boolean isEmpty()
Determine if this series is empty.

Returns:
True if this series is empty (length = 0), false otherwise.

x

public abstract double x(int i)
Returns the given X value in this series.

Parameters:
i - Index.
Returns:
The X value in this series at index i.
Throws:
ArrayIndexOutOfBoundsException - (unchecked exception) Thrown if i is not in the range 0 .. length()-1.

minX

public double minX()
Returns the minimum value in this series.

Returns:
Minimum X value.

maxX

public double maxX()
Returns the maximum value in this series.

Returns:
Maximum X value.

stats

public Series.Stats stats()
Returns a Stats object containing statistics of this series.

Note: The returned object contains the statistics of a snapshot of this series at the time stats() was called. Changing the data in this series will not change the contents of the returned object.

Returns:
Statistics.

robustStats

public Series.RobustStats robustStats()
Returns a RobustStats object containing robust statistics of this series.

Note: The returned object contains the statistics of a snapshot of this series at the time robustStats() was called. Changing the data in this series will not change the contents of the returned object.

Returns:
Robust statistics.

iterator

public Iterator<Double> iterator()
Returns an iterator over the values in this series.

Specified by:
iterator in interface Iterable<Double>
Returns:
Iterator.

print

public void print()
Print this series on the standard output. Each line of output consists of the index and the value, separated by a tab.


print

public void print(PrintStream theStream)
Print this series on the given print stream. Each line of output consists of the index and the value, separated by a tab.

Parameters:
theStream - Print stream.

print

public void print(PrintWriter theWriter)
Print this series on the given print writer. Each line of output consists of the index and the value, separated by a tab.

Parameters:
theWriter - Print writer.


Copyright © 2005-2012 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.