public static final class IntervalVolume.Builder extends Object
IntervalVolumes.
Rows, columns, and levels 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 |
|---|---|
IntervalVolume.Builder |
add(double row,
double column,
double level,
double value)
Add to the existing value at the specified row, column, and level.
|
IntervalVolume.Builder |
add(IntervalVolume volume)
Add the values in the supplied volume to this builder.
|
IntervalVolume.Builder |
add(int row,
int column,
int level,
double value)
Add to the existing value at the specified row, column, and level
indices.
|
IntervalVolume |
build()
Return a newly-created, immutable 3-dimensional interval data container
populated with the contents of this
Builder. |
IntervalVolume |
build(IntervalVolume.Loader loader)
Return a newly-created, immutable, 3-dimensional interval 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.
|
IntervalVolume.Builder |
columns(double min,
double max,
double Δ)
Define the data volume columns.
|
static IntervalVolume.Builder |
copyOf(IntervalVolume volume)
Create a new builder with the structure and content identical to that of
the supplied volume.
|
static IntervalVolume.Builder |
fromModel(IntervalVolume model)
Create a new builder with a structure identical to that of the supplied
model.
|
int |
levelIndex(double level)
Return the index of the level that would contain the supplied value.
|
IntervalVolume.Builder |
levels(double min,
double max,
double Δ)
Define the data volume levels.
|
IntervalVolume.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.
|
IntervalVolume.Builder |
rows(double min,
double max,
double Δ)
Define the data volume rows.
|
IntervalVolume.Builder |
set(double row,
double column,
double level,
double value)
Set the value at the specified row, column, and level.
|
IntervalVolume.Builder |
set(int row,
int column,
int level,
double value)
Set the value at the specified row, column, and level indices.
|
public static IntervalVolume.Builder copyOf(IntervalVolume volume)
volume - to copypublic static IntervalVolume.Builder fromModel(IntervalVolume model)
model - data volumepublic IntervalVolume.Builder rows(double min, double max, double Δ)
min - lower edge of lowermost row binmax - upper edge of uppermost row binΔ - bin discretizationpublic IntervalVolume.Builder columns(double min, double max, double Δ)
min - lower edge of lowermost column binmax - upper edge of uppermost column binΔ - bin discretizationpublic IntervalVolume.Builder levels(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 int levelIndex(double level)
level - valuepublic IntervalVolume.Builder set(double row, double column, double level, double value)
set(int, int, int, double).row - keycolumn - keylevel - keyvalue - to setpublic IntervalVolume.Builder set(int row, int column, int level, double value)
set(double, double, double, double).row - indexcolumn - indexlevel - indexvalue - to setpublic IntervalVolume.Builder add(double row, double column, double level, double value)
add(int, int, int, double).row - keycolumn - keylevel - keyvalue - to addpublic IntervalVolume.Builder add(int row, int column, int level, double value)
add(double, double, double, double).row - indexcolumn - indexlevel - indexvalue - public IntervalVolume.Builder add(IntervalVolume volume)
volume - to addIllegalArgumentException - if the rows, columns, and levels of the
supplied volume do not match those of this volumefromModel(IntervalVolume)public IntervalVolume.Builder multiply(double scale)
scale) all values in this builder.scale - factorpublic IntervalVolume build(IntervalVolume.Loader loader)
set* or
add* methods.loader - that will compute valuespublic IntervalVolume build()
Builder.