Class Binnable<T>

    • Field Detail

      • m_Payload

        protected T m_Payload
        the actual data object.
      • m_Value

        protected double m_Value
        the value to use for binning.
    • Constructor Detail

      • Binnable

        public Binnable​(T payload,
                        double value)
        Initializes the wrapper.
        Parameters:
        payload - the actual object
        value - the value to use for binning
      • Binnable

        public Binnable​(T payload,
                        double value,
                        Map<String,​Object> metaData)
        Initializes the wrapper.
        Parameters:
        payload - the actual object
        value - the value to use for binning
        metaData - the meta-data to use, ignored if null
    • Method Detail

      • getPayload

        public T getPayload()
        Returns the actual object.
        Returns:
        the payload
      • setValue

        public void setValue​(double value)
        Sets the value to use for the binning calculation.
        Parameters:
        value - the value
      • getValue

        public double getValue()
        Returns the value to use for the binning calculation.
        Returns:
        the value
      • hasMetaData

        public boolean hasMetaData()
        Returns if meta-data is present.
        Returns:
        true if meta-data there
      • addMetaData

        public Object addMetaData​(String key,
                                  Object value)
        Adds meta-data.
        Specified by:
        addMetaData in interface MetaDataSupporter
        Parameters:
        key - the key of the value
        value - the value to store
        Returns:
        any previously stored object for this key, otherwise null
      • removeMetaData

        public Object removeMetaData​(String key)
        Removes meta-data.
        Specified by:
        removeMetaData in interface MetaDataSupporter
        Parameters:
        key - the key of the value to remove
        Returns:
        the removed value, null if none removed
      • getMetaData

        public Object getMetaData​(String key)
        Rertrieves meta-data.
        Specified by:
        getMetaData in interface MetaDataSupporter
        Parameters:
        key - the key of the value to retrieve
        Returns:
        the associated value, null if none available
      • toString

        public String toString()
        Returns a short description of the wrapper.
        Overrides:
        toString in class Object
        Returns:
        the description
      • toString

        public String toString​(int decimals)
        Returns a short description of the wrapper.
        Parameters:
        decimals - the number of decimals in the output, -1 for no limit
        Returns:
        the description