Package frc.lib.math

Class Interval

java.lang.Object
frc.lib.math.Interval

public class Interval extends Object
A one-dimensional range.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Interval(double min, double max)
    A one-dimensional range.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Get if `other` is completely contained by this range.
    double
    Get upper extent of the range.
    double
    Get lower extent of the range.
    double
    Get length of common subset.
    boolean
    Get if two intervals share some common subset.
    void
    setMax(double max)
    Set upper extent of the range.
    void
    setMin(double min)
    Set lower extent of the range.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Interval

      public Interval(double min, double max)
      A one-dimensional range.
  • Method Details

    • getMin

      public double getMin()
      Get lower extent of the range.
    • setMin

      public void setMin(double min)
      Set lower extent of the range.
    • getMax

      public double getMax()
      Get upper extent of the range.
    • setMax

      public void setMax(double max)
      Set upper extent of the range.
    • overlaps

      public boolean overlaps(Interval other)
      Get if two intervals share some common subset.
    • getOverlap

      public double getOverlap(Interval other)
      Get length of common subset.
    • contains

      public boolean contains(Interval other)
      Get if `other` is completely contained by this range.