public abstract class Histogram
extends java.lang.Object
implements java.io.Serializable
ImplementationIF
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected static class |
Histogram.Extrema |
Modifier and Type | Field and Description |
---|---|
protected static int |
INCREASE |
protected boolean |
isClassMaximumValid |
protected boolean |
isClassMinimumValid |
protected java.util.Map<java.lang.String,java.lang.Object> |
parameters |
Constructor and Description |
---|
Histogram()
Initialize the histogram.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
calculate()
Calculate the histogram.
|
protected short[] |
getClasses(int numberOfBins,
double filterWidth,
double[] arr,
double min,
double max)
Classify data into a class array.
|
protected short[] |
getClasses(int numberOfBins,
double filterWidth,
float[] arr,
double min,
double max)
Classify data into a class array.
|
protected short[] |
getClasses(int numberOfBins,
double filterWidth,
int[] arr,
double min,
double max)
Classify data into a class array.
|
protected short[] |
getClasses(int numberOfBins,
double filterWidth,
long[] arr,
double min,
double max)
Classify data into a class array.
|
protected short[] |
getClasses(int numberOfBins,
double filterWidth,
short[] arr,
double min,
double max)
Classify data into a class array.
|
double |
getClassMaximum()
Gets the maximum of the class range.
|
double |
getClassMinimum()
Gets the minimum of the class range.
|
double |
getFilterWidthRelative()
Get the filter width.
|
double |
getMaximum()
Gets the maximum of the value range.
|
double |
getMinimum()
Gets the minimum of the value range.
|
int |
getNumberOfBins()
Gets the total number of classes.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParameters()
Get the paraemters.
|
java.lang.String |
getUnit()
Retrieves the unit string.
|
void |
setClassMaximum(double max)
Sets the maximum of the class range.
|
void |
setClassMinimum(double min)
Sets the minimum of the class range.
|
void |
setFilterWidthRelative(double filterWidth)
Set the width of the hysterese filter.
|
void |
setMaximum(double max)
Sets the maximum of the value range.
|
void |
setMinimum(double min)
Sets the minimum of the value range.
|
void |
setNumberOfBins(int numberOfBins)
Sets the total number of of classes.
|
void |
setParameters(java.util.Map<java.lang.String,java.lang.Object> map)
Set the paraemters.
|
void |
setUnit(java.lang.String unit)
Sets the unit string.
|
protected java.util.Map<java.lang.String,java.lang.Object> parameters
protected boolean isClassMinimumValid
protected boolean isClassMaximumValid
protected static final int INCREASE
public abstract void calculate() throws java.lang.Exception
java.lang.Exception
public void setNumberOfBins(int numberOfBins)
numberOfBins
- the total number of classes.public int getNumberOfBins()
setNumberOfBins(int)
public void setClassMinimum(double min)
dataMin - (dataMax-dataMin)/2/(numberOfBins-1)
.numberOfBins
- the total number of classes.public double getClassMinimum()
setClassMinimum(double)
public void setClassMaximum(double max)
dataMax + (dataMax-dataMin)/2/(numberOfBins-1)
.numberOfBins
- the total number of classes.public double getClassMaximum()
setClassMaximum(double)
public void setMinimum(double min)
min
- the minimum of the value range.public double getMinimum()
setClassMinimum(double)
public void setMaximum(double max)
max
- the maximum of the value range.public double getMaximum()
setClassMaximum(double)
public void setUnit(java.lang.String unit)
unit
- the unit string.public java.lang.String getUnit()
setUnit(String)
public void setFilterWidthRelative(double filterWidth)
filterWidth
- the width of the hysterese filter. This value must be specified reltative to the class width.
e.g. if this vlaue is 10 it means that the filter width is 0.1*classwdith.public double getFilterWidthRelative()
setFilterWidth(double)
public java.util.Map<java.lang.String,java.lang.Object> getParameters()
public void setParameters(java.util.Map<java.lang.String,java.lang.Object> map)
protected short[] getClasses(int numberOfBins, double filterWidth, float[] arr, double min, double max)
numberOfBins
- the total number of classes.fitlerWidth
- the width in percent of the class width.arr
- the data array.min
- the minimum of data value.max
- the maximum of data value.protected short[] getClasses(int numberOfBins, double filterWidth, double[] arr, double min, double max)
numberOfBins
- the total number of classes.fitlerWidth
- the width in percent of the class width.arr
- the data array.min
- the minimum of data value.max
- the maximum of data value.protected short[] getClasses(int numberOfBins, double filterWidth, short[] arr, double min, double max)
numberOfBins
- the total number of classes.fitlerWidth
- the width in percent of the class width.arr
- the data array.min
- the minimum of data value.max
- the maximum of data value.protected short[] getClasses(int numberOfBins, double filterWidth, int[] arr, double min, double max)
numberOfBins
- the total number of classes.fitlerWidth
- the width in percent of the class width.arr
- the data array.min
- the minimum of data value.max
- the maximum of data value.protected short[] getClasses(int numberOfBins, double filterWidth, long[] arr, double min, double max)
numberOfBins
- the total number of classes.fitlerWidth
- the width in percent of the class width.arr
- the data array.min
- the minimum of data value.max
- the maximum of data value.