edu.rit.numeric
Class Series
- java.lang.Object
-
- edu.rit.numeric.Series
-
- All Implemented Interfaces:
- java.lang.Iterable<java.lang.Double>
- Direct Known Subclasses:
- ArraySeries, ListSeries, TransformedSeries
public abstract class Series extends java.lang.Object implements java.lang.Iterable<java.lang.Double>Class Series is the abstract base class for a series of real values (type double).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classSeries.RobustStatsClass Series.RobustStats holds the median, mean absolute deviation, and quantiles of a Series.static classSeries.StatsClass Series.Stats holds the mean, variance, and standard deviation of a Series.
-
Constructor Summary
Constructors Constructor and Description Series()Construct a new series.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description booleanisEmpty()Determine if this series is empty.java.util.Iterator<java.lang.Double>iterator()Returns an iterator over the values in this series.abstract intlength()Returns the number of values in this series.doublemaxX()Returns the maximum value in this series.doubleminX()Returns the minimum value in this series.voidprint()Print this series on the standard output.voidprint(java.io.PrintStream theStream)Print this series on the given print stream.voidprint(java.io.PrintWriter theWriter)Print this series on the given print writer.Series.RobustStatsrobustStats()Returns a RobustStats object containing robust statistics of this series.Series.Statsstats()Returns a Stats object containing statistics of this series.abstract doublex(int i)Returns the given X value in this 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:
java.lang.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 java.util.Iterator<java.lang.Double> iterator()
Returns an iterator over the values in this series.- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.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(java.io.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(java.io.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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG