All Packages Class Hierarchy This Package Previous Next Index
Class hep.analysis.Abstract1DPartition
java.lang.Object
|
+----java.util.Observable
|
+----hep.analysis.Partition
|
+----hep.analysis.Abstract1DPartition
- public abstract class Abstract1DPartition
- extends Partition
The base class for all one-dimensional partitions. All fill
methods
will throw a PartitionFillException if not overridden. Therefore,
subclasses should override the methods corresponding to the data
types the subclass supports and leave the remaining ones to throw
exceptions. Similarly, all getBinAt
methods throw a
NoSuchBinException unless overridden so subclasses should override the
methods corresponding to the types that the subclass supports.
- See Also:
- PartitionFillException, NoSuchBinException
-
Abstract1DPartition()
-
-
clear()
- Resets the partition to default settings.
-
clearDataChanged()
- Indicate that all data changes have been acknowledged by the observer and that
the partition should resume sending new updates.
-
clearRangeChanged()
- Indicate that all range changes have been acknowledged by the observer and that
the partition should resume sending new updates.
-
destroy()
- Indicate that this partition is no longer needed.
-
done()
- Called when event loop is finished; sends a final update of any range and/or data change.
-
fill(Date)
- Invokes the
fill(Date, double)
method with
a weighting value of 1.
-
fill(Date, double)
- Fills the associated histogram with a date value.
-
fill(double)
- Invokes the
fill(double, double)
method with
a weighting value of 1.
-
fill(double, double)
- Fills the associated histogram with a numerical value.
-
fill(int)
- Invokes the
fill(int, double)
method with
a weighting value of 1.
-
fill(int, double)
- Converts the given
int
parameter to type
double
and calls fill(double, double)
.
-
fill(String)
- Invokes the
fill(String, double)
method with
a weighting value of 1.
-
fill(String, double)
- Fills the associated histogram with a string value.
-
getArea()
- Return the area of the distribution.
-
getAxisLabels()
- Override to allow axis labels to be accessed.
-
getAxisType()
- Return a static field from Rebinnable1DHistogramData.
-
getBin(int)
- Returns the size of the given bin.
-
getBinAt(Date)
- Returns the bin index corresponding to the given date value.
-
getBinAt(double)
- Returns the bin index corresponding to the given numerical value.
-
getBinAt(int)
- Converts the given
int
parameter to type
double
and invokes the method
getBinAt(double)
.
-
getBinAt(String)
- Returns the bin index corresponding to the given string value.
-
getBins()
- Return an array containing the sizes of all the bins.
-
getEntries()
- Return the number of entries.
-
getError(int)
- Returns the error for the given bin.
-
getErrors()
- Return an array containing the errors for all the bins.
-
getMax()
- Return the maximum in the distribution.
-
getMean()
- Return the mean of the distribution.
-
getMin()
- Return the minimum in the distribution.
-
getMinusError(int)
- Returns the minus error for the given bin.
-
getMinusErrors()
- Assumes symmetrical errors.
-
getNumberOfBins()
- Return the number of bins.
-
getOverflow()
- Return the overflow for the partition.
-
getPlusError(int)
- Returns the plus error for the given bin.
-
getPlusErrors()
- Assumes symmetrical errors.
-
getRMS()
- Return the RMS of the distribution.
-
getUnderflow()
- Return the underflow for the partition.
-
hasAsymmetricErrorBars()
- Returns false by default.
-
hasChanged()
- Do not call.
-
hasSimpleQuadraticErrorBars()
- Returns false by default.
-
isRebinnable()
- Returns false by default.
-
setBinning(int, double, double)
- Override to allow binning to be set.
-
setDataAndRangeChanged()
- Indicate that the data and range have changed and notify observers of the change.
-
setDataAndRangeChangedNow()
- Indicate that the data and range have changed and notify observers of the change with a final update.
-
setDataChanged()
- Indicate that the data have changed and notify observers of the change.
-
setRangeChanged()
- Indicate that the range has changed and notify observers of the change.
-
setSnapshot(boolean)
- Sets the snap shot mode of the partition.
Abstract1DPartition
public Abstract1DPartition()
fill
public void fill(double x,
double v)
- Fills the associated histogram with a numerical value. Subclasses must
override this method with a partition-specific implementation
to prevent a PartitionFillException (i.e., override this method if your
subclass will support numerical binning).
- Parameters:
- x - the value to fill
- v - a partition-specific value (normally some weighting value)
- Throws: PartitionFillException
- if this method is not overridden
- See Also:
- PartitionFillException
fill
public void fill(int x,
double v)
- Converts the given
int
parameter to type
double
and calls fill(double, double)
.
- Parameters:
- x - the value to fill
- v - a partition-specific value (normally some weighting value)
- Throws: PartitionFillException
- if thrown from
fill(double, double)
- See Also:
- fill, PartitionFillException
fill
public void fill(String x,
double v)
- Fills the associated histogram with a string value. Subclasses must
override this method with a partition-specific implementation
to prevent a PartitionFillException (i.e., override this method if your
subclass will support string binning).
- Parameters:
- x - the value to fill
- v - a partition-specific value (normally some weighting value)
- Throws: PartitionFillException
- if not overridden
- See Also:
- PartitionFillException
fill
public void fill(Date x,
double v)
- Fills the associated histogram with a date value. Subclasses must
override this method with a partition-specific implementation
to prevent a PartitionFillException (i.e., override this method if your
subclass will support date binning).
- Parameters:
- x - the value to fill
- v - a partition-specific value (normally some weighting value)
- Throws: PartitionFillException
- if not overridden
- See Also:
- PartitionFillException
fill
public void fill(double x)
- Invokes the
fill(double, double)
method with
a weighting value of 1.
- Parameters:
- x - the value to fill
- See Also:
- fill
fill
public void fill(int x)
- Invokes the
fill(int, double)
method with
a weighting value of 1.
- Parameters:
- x - the value to fill
- See Also:
- fill
fill
public void fill(String x)
- Invokes the
fill(String, double)
method with
a weighting value of 1.
- Parameters:
- x - the value to fill
- See Also:
- fill
fill
public void fill(Date x)
- Invokes the
fill(Date, double)
method with
a weighting value of 1.
- Parameters:
- x - the value to fill
- See Also:
- fill
getBinAt
public int getBinAt(double x) throws NoSuchBinException
- Returns the bin index corresponding to the given numerical value.
Subclasses must override this method to avoid getting a
NoSuchBinException (i.e., override this method if your
subclass will support numerical binning).
- Parameters:
- x - the value to map to a bin
- Returns:
- the bin index for the given parameter
x
- Throws: NoSuchBinException
- if not overridden
getBinAt
public int getBinAt(int x) throws NoSuchBinException
- Converts the given
int
parameter to type
double
and invokes the method
getBinAt(double)
.
- Throws: NoSuchBinException
- if thrown from
getBinAt(double)
- See Also:
- getBinAt
getBinAt
public int getBinAt(String x) throws NoSuchBinException
- Returns the bin index corresponding to the given string value.
Subclasses must override this method to avoid getting a
NoSuchBinException (i.e., override this method if your
subclass will support string binning).
- Parameters:
- x - the value to map to a bin
- Returns:
- the bin index for the given parameter
x
- Throws: NoSuchBinException
- if not overridden
getBinAt
public int getBinAt(Date x) throws NoSuchBinException
- Returns the bin index corresponding to the given date value.
Subclasses must override this method to avoid getting a
NoSuchBinException (i.e., override this method if your
subclass will support date binning).
- Parameters:
- x - the value to map to a bin
- Returns:
- the bin index for the given parameter
x
- Throws: NoSuchBinException
- if not overridden
getBin
public double getBin(int bin) throws NoSuchBinException
- Returns the size of the given bin.
- Parameters:
- bin - the bin to return the size of
- Returns:
- the size of the given bin
- Throws: NoSuchBinException
- if the parameter
bin
is invalid
hasAsymmetricErrorBars
public boolean hasAsymmetricErrorBars()
- Returns false by default. Override to have asymmetric error bars.
hasSimpleQuadraticErrorBars
public boolean hasSimpleQuadraticErrorBars()
- Returns false by default. Override to have simple quadratic error bars.
getPlusError
public double getPlusError(int bin)
- Returns the plus error for the given bin. Equivalent to
getPlusErrors()[bin]
.
- Parameters:
- bin - the bin to return the plus error on
- Returns:
- the plus error on the given bin
- Throws: NoSuchBinException
- if the parameter
bin
is invalid
- See Also:
- getPlusErrors
getMinusError
public double getMinusError(int bin)
- Returns the minus error for the given bin. Equivalent to
getMinusErrors()[bin]
.
- Parameters:
- bin - the bin to return the minus error on
- Returns:
- the plus error on the given bin
- Throws: NoSuchBinException
- if the parameter
bin
is invalid
- See Also:
- getMinusErrors
getPlusErrors
public double[] getPlusErrors()
- Assumes symmetrical errors. By default returns
getErrors()
. Override to provide support for
asymmetrical errors.
- Returns:
- an array of the plus errors for all of the bins
- See Also:
- getErrors
getMinusErrors
public double[] getMinusErrors()
- Assumes symmetrical errors. By default returns
getErrors()
. Override to provide support for
asymmetrical errors.
- Returns:
- an array of the minus errors for all of the bins
- See Also:
- getErrors
getError
protected double getError(int bin)
- Returns the error for the given bin. Equivaluent to
calling
getErrors()[bin]
.
- See Also:
- getErrors
isRebinnable
public boolean isRebinnable()
- Returns false by default. Override to have a rebinnable partition.
setBinning
public void setBinning(int bins,
double min,
double max)
- Override to allow binning to be set. Throws an
UnsupportedPartitionMethodException by default.
- Parameters:
- bins - the number of bins to have
- min - the minimum of the partition range
- max - the maximum of the partition range
- Throws: UnsupportedPartitionMethodException
- if not overridden.
getAxisLabels
public String[] getAxisLabels()
- Override to allow axis labels to be accessed. Throws an
UnsupportedPartitionMethodException by default.
- Returns:
- an array of axis labels
getAxisType
public int getAxisType()
- Return a static field from Rebinnable1DHistogramData.
Returns Rebinnable1DHistogramData.DOUBLE by default.
- See Also:
- Rebinnable1DHistogramData
getBins
public abstract double[] getBins()
- Return an array containing the sizes of all the bins.
getErrors
protected abstract double[] getErrors()
- Return an array containing the errors for all the bins.
getOverflow
public abstract double getOverflow()
- Return the overflow for the partition.
getUnderflow
public abstract double getUnderflow()
- Return the underflow for the partition.
getEntries
public abstract int getEntries()
- Return the number of entries.
getArea
public abstract double getArea()
- Return the area of the distribution.
getMean
public abstract double getMean()
- Return the mean of the distribution.
getRMS
public abstract double getRMS()
- Return the RMS of the distribution.
getNumberOfBins
public abstract int getNumberOfBins()
- Return the number of bins.
getMin
public abstract double getMin()
- Return the minimum in the distribution.
getMax
public abstract double getMax()
- Return the maximum in the distribution.
destroy
public final void destroy()
- Indicate that this partition is no longer needed.
- Overrides:
- destroy in class Partition
setDataChanged
protected void setDataChanged()
- Indicate that the data have changed and notify observers of the change.
setDataAndRangeChanged
protected void setDataAndRangeChanged()
- Indicate that the data and range have changed and notify observers of the change.
setDataAndRangeChangedNow
protected void setDataAndRangeChangedNow()
- Indicate that the data and range have changed and notify observers of the change with a final update.
clearDataChanged
protected void clearDataChanged()
- Indicate that all data changes have been acknowledged by the observer and that
the partition should resume sending new updates.
setRangeChanged
protected void setRangeChanged()
- Indicate that the range has changed and notify observers of the change.
clearRangeChanged
protected void clearRangeChanged()
- Indicate that all range changes have been acknowledged by the observer and that
the partition should resume sending new updates.
clear
public void clear()
- Resets the partition to default settings.
- Overrides:
- clear in class Partition
done
public void done()
- Called when event loop is finished; sends a final update of any range and/or data change.
- Overrides:
- done in class Partition
hasChanged
public final boolean hasChanged()
- Do not call. This method is public because it overrides the method in
Observable
.
- Overrides:
- hasChanged in class Observable
setSnapshot
public abstract void setSnapshot(boolean b)
- Sets the snap shot mode of the partition.
- Overrides:
- setSnapshot in class Partition
All Packages Class Hierarchy This Package Previous Next Index