Package uk.ac.starlink.ttools.plot
Interface MapBinnedData.BinMapper
-
- Enclosing class:
- MapBinnedData
public static interface MapBinnedData.BinMapper
Defines the mapping of numerical values to map keys. The keys must implementequals
andhashCode
properly.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double[]
getBounds(java.lang.Object key)
Returns the upper and lower bounds of the bin corresponding to a given key.java.lang.Comparable
getKey(double value)
Returns the key to use for a given value.java.util.Iterator
keyIterator(java.lang.Object loKey, java.lang.Object hiKey)
Returns an iterator which covers all keys between the given low and high keys inclusive.
-
-
-
Method Detail
-
getKey
java.lang.Comparable getKey(double value)
Returns the key to use for a given value. May returnnull
to 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
value
falls
-
getBounds
double[] getBounds(java.lang.Object 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 keyIterator(java.lang.Object loKey, java.lang.Object hiKey)
Returns an iterator which covers all keys between the given low and high keys inclusive.loKey
andhiKey
must 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
-
-