Class Range<T extends java.lang.Comparable<T>>


  • public class Range<T extends java.lang.Comparable<T>>
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void ifIncluded​(T value, java.util.function.Consumer<T> consumer)  
      boolean includes​(T value)  
      boolean isSingular()  
      <U extends java.lang.Comparable<U>>
      Range<U>
      map​(java.util.function.Function<T,​U> mapper)  
      static <T extends java.lang.Comparable<T>>
      Range<T>
      of​(T min, boolean minIncluded, T max, boolean maxIncluded)  
      static <T extends java.lang.Comparable<T>>
      Range<T>
      of​(T min, T max)  
      java.lang.String toString()  
      Range<T> withMax​(T newMax, boolean newMaxIncluded)  
      Range<T> withMin​(T newMin, boolean newMinIncluded)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • min

        public final T extends java.lang.Comparable<T> min
      • minIncluded

        public final boolean minIncluded
      • max

        public final T extends java.lang.Comparable<T> max
      • maxIncluded

        public final boolean maxIncluded
    • Method Detail

      • of

        public static <T extends java.lang.Comparable<T>> Range<T> of​(T min,
                                                                      T max)
      • of

        public static <T extends java.lang.Comparable<T>> Range<T> of​(T min,
                                                                      boolean minIncluded,
                                                                      T max,
                                                                      boolean maxIncluded)
      • isSingular

        public boolean isSingular()
      • includes

        public boolean includes​(T value)
      • ifIncluded

        public void ifIncluded​(T value,
                               java.util.function.Consumer<T> consumer)
      • map

        public <U extends java.lang.Comparable<U>> Range<U> map​(java.util.function.Function<T,​U> mapper)
      • withMin

        public Range<T> withMin​(T newMin,
                                boolean newMinIncluded)
      • withMax

        public Range<T> withMax​(T newMax,
                                boolean newMaxIncluded)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object