/** Numeric interval */ 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) { base= b; width= w; } /** Constructor: An Interval with base 0 and width w */ public Interval(double w) { this(0,w); } /** Constructor: An Interval with initial values given by declarations */ public Interval() {} /** =Get left end of interval */ public double getBase() { return base; } /** =Get right end of interval */ public double getEnd() { return base + width; } /** Set left end of interval to base */ public void setBase(double base) { this.base= base; } /** Set width of interval to w */ public void setWidth(double w) { width = w; } }