类 NumberRange<T extends Number>

java.lang.Object
io.github.palexdev.virtualizedfx.beans.NumberRange<T>
类型参数:
T - The type of Number to represent

public class NumberRange<T extends Number> extends Object
Simple bean to represent a range of values from min to max.
  • 构造器详细资料

    • NumberRange

      public NumberRange(T min, T max)
  • 方法详细资料

    • getMin

      public T getMin()
      返回:
      the upper bound
    • getMax

      public T getMax()
      返回:
      the lower bound
    • expandRange

      public static List<Integer> expandRange(NumberRange<Integer> range)
      Expands a range on integers to a List of integers.
    • expandRangeToSet

      public static Set<Integer> expandRangeToSet(NumberRange<Integer> range)
      Expands a range of integers to a Set of integers.
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • of

      public static <T extends Number> NumberRange<T> of(T min, T max)
      Returns a new instance of NumberRange with the given min and max bounds.
    • of

      public static <T extends Number> NumberRange<T> of(T val)
      Returns a new instance of NumberRange with the given val as both min and max bounds.
    • inRangeOf

      public static boolean inRangeOf(double val, NumberRange<Double> range)
      Checks if the given value is contained in the given range (bounds are included).
    • inRangeOf

      public static boolean inRangeOf(float val, NumberRange<Float> range)
      Checks if the given value is contained in the given range (bounds are included).
    • inRangeOf

      public static boolean inRangeOf(int val, NumberRange<Integer> range)
      Checks if the given value is contained in the given range (bounds are included).
    • inRangeOf

      public static boolean inRangeOf(long val, NumberRange<Long> range)
      Checks if the given value is contained in the given range (bounds are included).
    • inRangeOf

      public static boolean inRangeOf(double val, List<NumberRange<Double>> ranges)
      Checks if the given value is contained in any of the given ranges (bounds are included).
    • inRangeOf

      public static boolean inRangeOf(float val, List<NumberRange<Float>> ranges)
      Checks if the given value is contained in any of the given ranges (bounds are included).
    • inRangeOf

      public static boolean inRangeOf(int val, List<NumberRange<Integer>> ranges)
      Checks if the given value is contained in any of the given ranges (bounds are included).
    • inRangeOf

      public static boolean inRangeOf(long val, List<NumberRange<Long>> ranges)
      Checks if the given value is contained in any of the given ranges (bounds are included).