/** Numeric interval:  [base, base+width]
 */
class Interval {

  private double base;  // low end
  private double width; // interval width
   
  /** Constructor: An Interval has base b and width w */
  public Interval(double b, double w) {
    setBase(b);
    setWidth(w);
  }
  
  /** =Get right end of this Interval */
  public double getEnd() { return base + width; }
  
  /** =Get base of this Interval */
  public double getBase() { return base; }
  
  /** Set base of this Interval to b */
  public void setBase(double b) { base= b; }

  /** Set width of this Interval to w */
  public void setWidth(double w) { width= w; }
  
  /** Expand this Interval by a factor of f (expand to the right) */
  public void expand(double f) {
    setWidth(width*f);

  /** =String description of this Interval */
  public String toString(){
    return "[" + getBase() + "," + getEnd() + "]";
  }
  
} //class Interval

