Interface PaletteEntry
- All Known Implementing Classes:
PaletteEntryForRange
,PaletteEntryForValue
public interface PaletteEntry
Defines an interface for specifying color assignments to floating point values.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates that the entry covers exactly one unique value (including, potentially, Float.NaN).int
getArgb
(float f) Gets the integer ARGB color assignment associated with the input value.getColor
(float f) Gets the color assignment associated with the input value.float
Gets the lower-bound value for the palette entryfloat
Gets the upper-bound value for the palette entryboolean
isCovered
(float f) Indicates whether the indicated floating-point value is within the range covered by this palette entry and can be assigned a valid color by the implementation.
-
Method Details
-
coversSingleEntry
boolean coversSingleEntry()Indicates that the entry covers exactly one unique value (including, potentially, Float.NaN).- Returns:
- true if the entry covers exactly one unique value
-
getArgb
Gets the integer ARGB color assignment associated with the input value. If the input value is not within the covered range of this instance, the return value is undefined (though the value zero is often used).- Parameters:
f
- valid floating point value, or a NaN.- Returns:
- an integer value
-
getColor
Gets the color assignment associated with the input value. If the input value is not within the covered range of this instance, the return value is undefined (though a null return is often used).- Parameters:
f
- a valid floating point value, or a NaN.- Returns:
- a valid color instance or, potentially, a null if the floating point input is not within the covered range.
-
getLowerBound
float getLowerBound()Gets the lower-bound value for the palette entry- Returns:
- if defined, a valid floating point value; otherwise, a null.
-
getUpperBound
float getUpperBound()Gets the upper-bound value for the palette entry- Returns:
- if defined, a valid floating point value; otherwise, a null.
-
isCovered
Indicates whether the indicated floating-point value is within the range covered by this palette entry and can be assigned a valid color by the implementation.- Parameters:
f
- a valid floating point value, or a NaN.- Returns:
- true if the entry can assign a color to the entry; otherwise, false.
-