public static final class IntervalTable.Builder extends Object
IntervalTables.
Rows and columns must be specified before any data can be added. Note
that any supplied max values may not correspond to the final upper
edge of the uppermost bins if max - min is not evenly divisible by
Δ .
| Constructor and Description |
|---|
Builder()
Create a new builder.
|
| Modifier and Type | Method and Description |
|---|---|
IntervalTable.Builder |
add(double row,
double[] values)
Add to the values in the specified row.
|
IntervalTable.Builder |
add(double row,
double column,
double value)
Add to the existing value at the specified row and column.
|
IntervalTable.Builder |
add(double row,
double column,
double[] values)
Add to the values in the specified row starting at the specified column.
|
IntervalTable.Builder |
add(double row,
double column,
List<Double> values)
Add to the values in the specified row starting at the specified column.
|
IntervalTable.Builder |
add(double row,
List<Double> values)
Add to the values in the specified row.
|
IntervalTable.Builder |
add(double row,
XySequence sequence)
Add the y-values of the supplied sequence to the values in the specified
row.
|
IntervalTable.Builder |
add(IntervalTable table)
Add the values in the supplied table to this builder.
|
IntervalTable.Builder |
add(int row,
int column,
double value)
Add to the existing value at the specified row and column indices.
|
IntervalTable |
build()
Return a newly-created, immutable, 2-dimensional data container populated
with the contents of this
Builder. |
IntervalTable |
build(IntervalTable.Loader loader)
Return a newly-created, immutable, 2-dimensional data container populated
with values computed by the supplied loader.
|
int |
columnIndex(double column)
Return the index of the column that would contain the supplied value.
|
IntervalTable.Builder |
columns(double min,
double max,
double Δ)
Define the table column intervals.
|
static IntervalTable.Builder |
copyOf(IntervalTable table)
Create a new builder with the structure and content identical to that of
the supplied table.
|
static IntervalTable.Builder |
fromModel(IntervalTable model)
Create a new builder with a structure identical to that of the supplied
model.
|
IntervalTable.Builder |
multiply(double scale)
Multiply (
scale) all values in this builder. |
int |
rowIndex(double row)
Return the index of the row that would contain the supplied value.
|
IntervalTable.Builder |
rows(double min,
double max,
double Δ)
Define the table row intervals.
|
IntervalTable.Builder |
set(double row,
double column,
double value)
Set the value at the specified row and column.
|
IntervalTable.Builder |
set(int row,
int column,
double value)
Set the value at the specified row and column indices.
|
public static IntervalTable.Builder copyOf(IntervalTable table)
table - to copypublic static IntervalTable.Builder fromModel(IntervalTable model)
model - data tablepublic IntervalTable.Builder rows(double min, double max, double Δ)
min - lower edge of lowermost row binmax - upper edge of uppermost row binΔ - bin discretizationpublic IntervalTable.Builder columns(double min, double max, double Δ)
min - lower edge of lowermost column binmax - upper edge of uppermost column binΔ - bin discretizationpublic int rowIndex(double row)
row - valuepublic int columnIndex(double column)
column - valuepublic IntervalTable.Builder set(double row, double column, double value)
set(int, int, double).row - keycolumn - keyvalue - to setpublic IntervalTable.Builder set(int row, int column, double value)
set(double, double, double).row - indexcolumn - indexvalue - to setpublic IntervalTable.Builder add(double row, double column, double value)
add(int, int, double).row - keycolumn - keyvalue - to addpublic IntervalTable.Builder add(int row, int column, double value)
add(double, double, double) .row - indexcolumn - indexvalue - to addpublic IntervalTable.Builder add(double row, double[] values)
row - keyvalues - to addIndexOutOfBoundsException - if values overrun rowpublic IntervalTable.Builder add(double row, List<Double> values)
row - keyvalues - to addIndexOutOfBoundsException - if values overrun rowpublic IntervalTable.Builder add(double row, XySequence sequence)
row - keysequence - to addIndexOutOfBoundsException - if values overrun rowpublic IntervalTable.Builder add(double row, double column, double[] values)
row - keycolumn - key from which to start adding valuesvalues - to addIndexOutOfBoundsException - if values overrun rowpublic IntervalTable.Builder add(double row, double column, List<Double> values)
row - keycolumn - key from which to start adding valuesvalues - to addIndexOutOfBoundsException - if values will overrun rowpublic IntervalTable.Builder add(IntervalTable table)
table - to addIllegalArgumentException - if the rows and columns of the supplied
table do not match those of this tablefromModel(IntervalTable)public IntervalTable.Builder multiply(double scale)
scale) all values in this builder.scale - factorpublic IntervalTable build(IntervalTable.Loader loader)
set* or add*
methods.loader - that will compute valuespublic IntervalTable build()
Builder.