Package uk.ac.starlink.ttools.plot
Class NormalisedBinnedData
- java.lang.Object
-
- uk.ac.starlink.ttools.plot.NormalisedBinnedData
-
- All Implemented Interfaces:
BinnedData
public class NormalisedBinnedData extends java.lang.Object implements BinnedData
Wrapper implementation of BinnedData which normalises bins so that the total value of all bins in a given subset is unity.- Since:
- 28 May 2008
- Author:
- Mark Taylor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface uk.ac.starlink.ttools.plot.BinnedData
BinnedData.Bin
-
-
Constructor Summary
Constructors Constructor Description NormalisedBinnedData(BinnedData base)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Iterator<BinnedData.Bin>
getBinIterator(boolean includeEmpty)
Returns an iterator over the bins managed by this object.int
getSetCount()
Returns the number of subsets for which this object maintains bins.boolean
isInteger()
Returns false.void
submitDatum(double value, double weight, boolean[] setFlags)
Submits a value for inclusion in this BinnedData object.
-
-
-
Constructor Detail
-
NormalisedBinnedData
public NormalisedBinnedData(BinnedData base)
Constructor.- Parameters:
base
- binned data object providing basic functionality
-
-
Method Detail
-
submitDatum
public void submitDatum(double value, double weight, boolean[] setFlags)
Description copied from interface:BinnedData
Submits a value for inclusion in this BinnedData object. As well as the value itself and a weight, a mask of boolean flags is given that indicates which subsets are considered to contain the submitted value.- Specified by:
submitDatum
in interfaceBinnedData
- Parameters:
value
- value for inclusionweight
- weightingsetFlags
- array of flags, one for each subset; true for inclusion, false for exclusion
-
getSetCount
public int getSetCount()
Description copied from interface:BinnedData
Returns the number of subsets for which this object maintains bins.- Specified by:
getSetCount
in interfaceBinnedData
- Returns:
- set count
-
isInteger
public boolean isInteger()
Returns false.- Specified by:
isInteger
in interfaceBinnedData
- Returns:
- true if all
Bin.getWeightedCount
returns are integer values
-
getBinIterator
public java.util.Iterator<BinnedData.Bin> getBinIterator(boolean includeEmpty)
Description copied from interface:BinnedData
Returns an iterator over the bins managed by this object. The bins must be returned in order (lowest data range bin to highest data range bin).It is inadvisable to call
BinnedData.submitDatum(double, double, boolean[])
during the lifetime of this iterator.- Specified by:
getBinIterator
in interfaceBinnedData
- Parameters:
includeEmpty
- if true, then all bins between the lowest and highest must be iterated over. If false, then empty bins may be omitted- Returns:
- iterator which dispenses
BinnedData.Bin
instances
-
-