|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataTable
A two-dimensional table with x values for the rows and column names for
the columns, and y values as the data in the columns (i.e. a set of data
series with identical x-values). Columns are allowed to have missing data;
the method getY
extrapolates from the values at higher and lower
x's. (@link getLowestx}, getHighestX
, and getNextX
only
return x values for which the given column has data; they can be used to
implement an iterator over actual data in a column.
The interface is designed to be made thread-safe with the Swing event
thread; reader methods should wait for writers
and writer threads should
run the actual data-modifying routines on the Swing event thread.
Method Summary | |
---|---|
void |
addColumn(java.lang.String name)
Adds a column or erases it if it already exists |
int |
getColumnNumber(java.lang.String name)
Find the column index for a given column. |
double |
getCount(int c)
returns the number of data points in a column |
double |
getHighestX(int c)
returns the highest x value for which a column has data |
double |
getLowestX(int c)
returns the lowest x value for which a column has data |
double |
getNextX(int c,
double x)
returns the next x value for which a column has data |
double |
getNthX(int c,
int n)
returns the nth x value for which data exists in a column. |
double |
getY(double x,
int c)
return the y value of a given x value and column. |
void |
setY(double x,
int c,
double y)
Set the y value of a given x-value and column. |
Method Detail |
---|
int getColumnNumber(java.lang.String name)
name
- the column name to look for
java.lang.IllegalArgumentException
- if the column does not existdouble getY(double x, int c)
x
- the X-valuec
- the column number (column -1 is the X-value)
java.lang.ArrayIndexOutOfBoundsException
- if the row or column do not existdouble getLowestX(int c)
c
- the column to search
java.lang.ArrayIndexOutOfBoundsException
- if the column does not existdouble getHighestX(int c)
c
- the column to search
java.lang.ArrayIndexOutOfBoundsException
- if the column does not existdouble getNextX(int c, double x)
c
- the column to searchx
- the previous x value
java.lang.ArrayIndexOutOfBoundsException
- if the column does not existdouble getNthX(int c, int n)
n
- which x value to returnc
- the column to search
java.lang.ArrayIndexOutOfBoundsException
- if the column does not exist
java.lang.IllegalArgumentException
- if there are less than n data pointsdouble getCount(int c)
c
- the column to search
java.lang.ArrayIndexOutOfBoundsException
- if the column does not existvoid setY(double x, int c, double y)
x
- the x valuec
- the column numbery
- the new value
java.lang.ArrayIndexOutOfBoundsException
- if the row or column do not existvoid addColumn(java.lang.String name)
name
- the name of the new column
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |