Class ObjHistogram<T>

  • Type Parameters:
    T - Data type
    All Implemented Interfaces:
    Histogram
    Direct Known Subclasses:
    AbstractObjDynamicHistogram

    public class ObjHistogram<T>
    extends AbstractStaticHistogram
    Histogram class storing double values.

    The histogram will start with "bin" bins, but it can grow dynamicall to the left and right.

    Since:
    0.5.5
    Author:
    Erich Schubert
    • Field Detail

      • data

        java.lang.Object[] data
        Data store
      • special

        java.lang.Object[] special
        Special value storage: infinity, NaN
    • Constructor Detail

      • ObjHistogram

        public ObjHistogram​(int bins,
                            double min,
                            double max,
                            ObjHistogram.BucketFactory<T> supplier)
        Constructor.
        Parameters:
        bins - Number of bins
        min - Cover minimum
        max - Cover maximum
        supplier - Supplier to fill empty bins
    • Method Detail

      • get

        public T get​(double coord)
        Access the value of a bin with new data.
        Parameters:
        coord - Coordinate
        Returns:
        bin contents
      • getSpecial

        protected T getSpecial​(int idx)
        Ensure that we have storage for special values (infinity, NaN)
        Parameters:
        idx - Index to return.