Package 

Interface Extras


  • 
    public interface Extras
    
                        

    An 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 Unit putExtra(Object key, Object value) Saves an extra.
      abstract Boolean hasExtra(Object key) Checks whether an extra with the given key exists.
      abstract <T extends Any> T getExtra(Object key) Retrieves the value of the extra with the given key, unless no such extra exists.
      abstract <T extends Any> T consumeExtra(Object key) Retrieves the value of the extra with the given key, unless no such extra exists.
      Unit set(Object key, Object value) Operator function for putExtra.
      <T extends Any> T get(Object key) Operator function for consumeExtra.
      abstract Unit clearExtras() Removes all stored extras.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.