Interface Range<V>

    • Method Detail

      • getMin

        V getMin()
        Returns:
        the lower bound of this range or null if no lower bound is defined. Has to be less than max if both boundaries are not null.
      • getMax

        V getMax()
        Returns:
        the upper bound of this range or null if no upper bound is defined. Has to be greater than min if both boundaries are not null.
      • getComparator

        default Comparator<? super V> getComparator()
        Returns:
        the Comparator used to compare values of this Range. The default implementation assumes that the value type implements Comparable. If you want to use other value types you need to override this method.
      • contains

        default boolean contains​(V value)
        This method determines if the given value is within this Range from minimum to maximum.
        Parameters:
        value - is the vale to check.
        Returns:
        true if contained (minimum <= value >= maximum), false otherwise. If the given value is null, false will be returned.
      • clip

        default V clip​(V value)
        This method clips the given value so the result is contained in this Range unless the given value is null.
        Parameters:
        value - is the vale to clip. May be null.
        Returns:
        the given value clipped to this range. If the given value is less than the minimum, that minimum will be returned. If the given value is greater than the maximum, that maximum will be returned. Otherwise the given value is returned.