-
public interface ExtrasAn abstraction layer over Map used by MeasureContext and ChartDrawContext to store and retrieve data.
Extras are kept in memory while measuring or drawing is taking place. Afterwards, they are removed.
-
-
Method Summary
Modifier and Type Method Description abstract UnitputExtra(Object key, Object value)Saves an extra. abstract BooleanhasExtra(Object key)Checks whether an extra with the given key exists. abstract <T extends Any> TgetExtra(Object key)Retrieves the value of the extra with the given key, unless no such extra exists. abstract <T extends Any> TconsumeExtra(Object key)Retrieves the value of the extra with the given key, unless no such extra exists. Unitset(Object key, Object value)Operator function for putExtra. <T extends Any> Tget(Object key)Operator function for consumeExtra. abstract UnitclearExtras()Removes all stored extras. -
-
Method Detail
-
putExtra
abstract Unit putExtra(Object key, Object value)
Saves an extra.
- Parameters:
key- the extra’s unique identifier.value- the extra’s value.
-
getExtra
abstract <T extends Any> T getExtra(Object key)
Retrieves the value of the extra with the given key, unless no such extra exists.
-
consumeExtra
abstract <T extends Any> T consumeExtra(Object key)
Retrieves the value of the extra with the given key, unless no such extra exists. Once the value of the extra is retrieved, the extra is removed. Use getExtra to prevent the extra from being removed.
-
get
<T extends Any> T get(Object key)
Operator function for consumeExtra.
-
clearExtras
abstract Unit clearExtras()
Removes all stored extras.
-
-
-
-