Class IntervalBooleanMap

    • Constructor Detail

      • IntervalBooleanMap

        public IntervalBooleanMap()
        Default constructor.

        The map is empty with zero capacity.

      • IntervalBooleanMap

        public IntervalBooleanMap​(int capacity)
        Constructor with capacity.

        Using this constructor can improve performances if the number of timestamps is known in advance as it minimizes array resizes.

        Parameters:
        capacity - timestamp capacity
      • IntervalBooleanMap

        public IntervalBooleanMap​(double[] keys,
                                  boolean[] vals)
        Constructor with an initial interval map.

        The keys array must be in the same format returned by IntervalMap.getIntervals().

        Parameters:
        keys - initial keys content
        vals - initial values content
    • Method Detail

      • getBoolean

        public boolean getBoolean​(Interval interval)
        Get the value for the given interval.
        Parameters:
        interval - interval
        Returns:
        found value or the default value if not found
        Throws:
        IllegalArgumentException - if the element doesn't exist
      • getBoolean

        public boolean getBoolean​(Interval interval,
                                  boolean defaultValue)
        Get the value for the given interval.

        Return defaultValue if the value is not found.

        Parameters:
        interval - interval
        defaultValue - default value
        Returns:
        found value or the default value if not found
      • toBooleanArray

        public boolean[] toBooleanArray()
        Returns an array of all values in this map.

        This method may return a reference to the underlying array so clients should make a copy if the array is written to.

        Returns:
        array of all values
      • getTypeClass

        public Class<Boolean> getTypeClass()
        Description copied from interface: TimeMap
        Returns the value type class.
        Returns:
        type class
      • isSupported

        public boolean isSupported​(Estimator estimator)
        Description copied from interface: TimeMap
        Returns whether estimator is supported.
        Parameters:
        estimator - estimator
        Returns:
        true if this map supports estimator