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

Constructor Index

 o Abstract1DPartition()

Method Index

 o clear()
Resets the partition to default settings.
 o clearDataChanged()
Indicate that all data changes have been acknowledged by the observer and that the partition should resume sending new updates.
 o clearRangeChanged()
Indicate that all range changes have been acknowledged by the observer and that the partition should resume sending new updates.
 o destroy()
Indicate that this partition is no longer needed.
 o done()
Called when event loop is finished; sends a final update of any range and/or data change.
 o fill(Date)
Invokes the fill(Date, double) method with a weighting value of 1.
 o fill(Date, double)
Fills the associated histogram with a date value.
 o fill(double)
Invokes the fill(double, double) method with a weighting value of 1.
 o fill(double, double)
Fills the associated histogram with a numerical value.
 o fill(int)
Invokes the fill(int, double) method with a weighting value of 1.
 o fill(int, double)
Converts the given int parameter to type double and calls fill(double, double).
 o fill(String)
Invokes the fill(String, double) method with a weighting value of 1.
 o fill(String, double)
Fills the associated histogram with a string value.
 o getArea()
Return the area of the distribution.
 o getAxisLabels()
Override to allow axis labels to be accessed.
 o getAxisType()
Return a static field from Rebinnable1DHistogramData.
 o getBin(int)
Returns the size of the given bin.
 o getBinAt(Date)
Returns the bin index corresponding to the given date value.
 o getBinAt(double)
Returns the bin index corresponding to the given numerical value.
 o getBinAt(int)
Converts the given int parameter to type double and invokes the method getBinAt(double).
 o getBinAt(String)
Returns the bin index corresponding to the given string value.
 o getBins()
Return an array containing the sizes of all the bins.
 o getEntries()
Return the number of entries.
 o getError(int)
Returns the error for the given bin.
 o getErrors()
Return an array containing the errors for all the bins.
 o getMax()
Return the maximum in the distribution.
 o getMean()
Return the mean of the distribution.
 o getMin()
Return the minimum in the distribution.
 o getMinusError(int)
Returns the minus error for the given bin.
 o getMinusErrors()
Assumes symmetrical errors.
 o getNumberOfBins()
Return the number of bins.
 o getOverflow()
Return the overflow for the partition.
 o getPlusError(int)
Returns the plus error for the given bin.
 o getPlusErrors()
Assumes symmetrical errors.
 o getRMS()
Return the RMS of the distribution.
 o getUnderflow()
Return the underflow for the partition.
 o hasAsymmetricErrorBars()
Returns false by default.
 o hasChanged()
Do not call.
 o hasSimpleQuadraticErrorBars()
Returns false by default.
 o isRebinnable()
Returns false by default.
 o setBinning(int, double, double)
Override to allow binning to be set.
 o setDataAndRangeChanged()
Indicate that the data and range have changed and notify observers of the change.
 o setDataAndRangeChangedNow()
Indicate that the data and range have changed and notify observers of the change with a final update.
 o setDataChanged()
Indicate that the data have changed and notify observers of the change.
 o setRangeChanged()
Indicate that the range has changed and notify observers of the change.
 o setSnapshot(boolean)
Sets the snap shot mode of the partition.

Constructors

 o Abstract1DPartition
 public Abstract1DPartition()

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o hasAsymmetricErrorBars
 public boolean hasAsymmetricErrorBars()
Returns false by default. Override to have asymmetric error bars.

 o hasSimpleQuadraticErrorBars
 public boolean hasSimpleQuadraticErrorBars()
Returns false by default. Override to have simple quadratic error bars.

 o 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
 o 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
 o 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
 o 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
 o getError
 protected double getError(int bin)
Returns the error for the given bin. Equivaluent to calling getErrors()[bin].

See Also:
getErrors
 o isRebinnable
 public boolean isRebinnable()
Returns false by default. Override to have a rebinnable partition.

 o 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.
 o getAxisLabels
 public String[] getAxisLabels()
Override to allow axis labels to be accessed. Throws an UnsupportedPartitionMethodException by default.

Returns:
an array of axis labels
 o getAxisType
 public int getAxisType()
Return a static field from Rebinnable1DHistogramData. Returns Rebinnable1DHistogramData.DOUBLE by default.

See Also:
Rebinnable1DHistogramData
 o getBins
 public abstract double[] getBins()
Return an array containing the sizes of all the bins.

 o getErrors
 protected abstract double[] getErrors()
Return an array containing the errors for all the bins.

 o getOverflow
 public abstract double getOverflow()
Return the overflow for the partition.

 o getUnderflow
 public abstract double getUnderflow()
Return the underflow for the partition.

 o getEntries
 public abstract int getEntries()
Return the number of entries.

 o getArea
 public abstract double getArea()
Return the area of the distribution.

 o getMean
 public abstract double getMean()
Return the mean of the distribution.

 o getRMS
 public abstract double getRMS()
Return the RMS of the distribution.

 o getNumberOfBins
 public abstract int getNumberOfBins()
Return the number of bins.

 o getMin
 public abstract double getMin()
Return the minimum in the distribution.

 o getMax
 public abstract double getMax()
Return the maximum in the distribution.

 o destroy
 public final void destroy()
Indicate that this partition is no longer needed.

Overrides:
destroy in class Partition
 o setDataChanged
 protected void setDataChanged()
Indicate that the data have changed and notify observers of the change.

 o setDataAndRangeChanged
 protected void setDataAndRangeChanged()
Indicate that the data and range have changed and notify observers of the change.

 o setDataAndRangeChangedNow
 protected void setDataAndRangeChangedNow()
Indicate that the data and range have changed and notify observers of the change with a final update.

 o clearDataChanged
 protected void clearDataChanged()
Indicate that all data changes have been acknowledged by the observer and that the partition should resume sending new updates.

 o setRangeChanged
 protected void setRangeChanged()
Indicate that the range has changed and notify observers of the change.

 o clearRangeChanged
 protected void clearRangeChanged()
Indicate that all range changes have been acknowledged by the observer and that the partition should resume sending new updates.

 o clear
 public void clear()
Resets the partition to default settings.

Overrides:
clear in class Partition
 o 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
 o hasChanged
 public final boolean hasChanged()
Do not call. This method is public because it overrides the method in Observable.

Overrides:
hasChanged in class Observable
 o 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