<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package JavadocDemo;

/** An {@code Interval} represents a closed interval [a,b]
 * on the real number line. It can also represent the empty set.
 * 
 * @author Andrew Myers
 */
public interface Interval {
	/** Add two intervals. The sum of two intervals is
	 * a set of values containing all the possible sums of
	 * two values, one from each of the two intervals.
	 * @param i the other interval
	 * @return the sum of the two intervals
	 */
	Interval add(Interval i);
	
	/** Test whether a value is in the interval.
	 * 
	 * @param x the value
	 * @return true if {@code x} is in the given interval.
	 */
	boolean contains(float x);
	
	/** Intersect two intervals.
	 * 
	 * @param i the other interval
	 * @return the intersection of {@code this} and {@code i}
	 */
	Interval intersect(Interval i);
	
	/** Test whether an interval is empty.
	 * @return true if this interval is empty.
	 */
	boolean empty();
}
</pre></body></html>