Package uk.ac.starlink.ttools.plot
Interface MapBinnedData.BinMapper<K extends java.lang.Comparable<K>>
-
- Enclosing class:
- MapBinnedData<K extends java.lang.Comparable<K>>
public static interface MapBinnedData.BinMapper<K extends java.lang.Comparable<K>>Defines the mapping of numerical values to map keys. The keys must implementequalsandhashCodeproperly.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MapBinnedData<K>createBinnedData(int nset)Creates a BinnedData instance based on this mapper.double[]getBounds(K key)Returns the upper and lower bounds of the bin corresponding to a given key.KgetKey(double value)Returns the key to use for a given value.java.util.Iterator<K>keyIterator(K loKey, K hiKey)Returns an iterator which covers all keys between the given low and high keys inclusive.
-
-
-
Method Detail
-
getKey
K getKey(double value)
Returns the key to use for a given value. May returnnullto indicate that the given value cannot be binned.- Parameters:
value- numerical value- Returns:
- object to be used as a key for the bin into which
valuefalls
-
getBounds
double[] getBounds(K key)
Returns the upper and lower bounds of the bin corresponding to a given key.- Parameters:
key- bin key object- Returns:
- 2-element array giving (lower,upper) bound for
bin
key
-
keyIterator
java.util.Iterator<K> keyIterator(K loKey, K hiKey)
Returns an iterator which covers all keys between the given low and high keys inclusive.loKeyandhiKeymust be possible keys for this mapper and arranged in the right order.- Parameters:
loKey- lower bound (inclusive) for key iterationhiKey- upper bound (inclusive) for key iteration- Returns:
- iterator
-
createBinnedData
MapBinnedData<K> createBinnedData(int nset)
Creates a BinnedData instance based on this mapper.- Parameters:
nset- the number of subsets that the BinnedData can deal with- Returns:
- binned data instance
-
-