Class Interval

java.lang.Object
org.ampere.base.util.Interval

public class Interval extends Object
implements Interval, i.e. [min,max].
Author:
Herve Morel
  • Constructor Details

    • Interval

      public Interval(double min, double max)
      Creates a new instance of Interval
      Parameters:
      min - minimal value
      max - maximal value
  • Method Details

    • getMinimum

      public double getMinimum()
      Returns:
      the minimum of the interval
    • getMaximum

      public double getMaximum()
      Returns:
      the maximum of the interval
    • getSize

      public double getSize()
    • isVoid

      public boolean isVoid()
      Returns:
      true if the Interval is void.
    • include

      public boolean include(double x)
      Parameters:
      x - input value
      Returns:
      true if the interval includes the input value
    • intersection

      public Interval intersection(Interval other)
      Build the intersection with another interval
      Parameters:
      other - input Interval to build an intersection
      Returns:
      the intersection of the interval with the other one
    • union

      public Interval union(Interval other)
      Build the union with another interval
      Parameters:
      other - input Interval to build an union
      Returns:
      the union of the interval with the other one
    • diameter

      public double diameter()
    • toString

      public String toString()
      Overrides:
      toString in class Object