Class FloatRange

java.lang.Object
dev.jorel.commandapi.wrappers.FloatRange

public class FloatRange extends Object
A class representing a range of floats
  • Constructor Details

    • FloatRange

      public FloatRange(float low, float high)
      Constructs a FloatRange with a lower bound and an upper bound
      Parameters:
      low - the lower bound of this range
      high - the upper bound of this range
  • Method Details

    • floatRangeGreaterThanOrEq

      public static FloatRange floatRangeGreaterThanOrEq(float min)
      Constructs a FloatRange with a given lower bound and no upper bound
      Parameters:
      min - the lower bound of this range
      Returns:
      a FloatRange min..
    • floatRangeLessThanOrEq

      public static FloatRange floatRangeLessThanOrEq(float max)
      Constructs a FloatRange with a given upper bound and no lower bound
      Parameters:
      max - the upper bound of this range
      Returns:
      a FloatRange ..max
    • getLowerBound

      public float getLowerBound()
      The lower bound of this range.
      Returns:
      the lower bound of this range
    • getUpperBound

      public float getUpperBound()
      The upper bound of this range.
      Returns:
      the upper bound of this range
    • isInRange

      public boolean isInRange(float f)
      Determines if a float is within range of the lower bound (inclusive) and the upper bound (inclusive).
      Parameters:
      f - the float to check within range
      Returns:
      true if the given float is within the declared range
    • toString

      public String toString()
      Converts this FloatRange to a Minecraft string for use with arguments
      Overrides:
      toString in class Object
      Returns:
      a Minecraft string for use with arguments
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object