public class ClosedInterval extends Interval
| Constructor and Description |
|---|
ClosedInterval()
Default constructor - creates a new instance of Interval with one point,
the origin.
|
ClosedInterval(double pt)
Initializing constructor - creates a single point (zero length) interval
given by the value of the argument
pt. |
ClosedInterval(double min,
double max)
Initializing constructor - create a new open interval with specified
endpoints.
|
ClosedInterval(Interval I)
Copy constructor - create a new open interval initialized to the argument.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(ClosedInterval I)
Is the given interval a subset of this interval.
|
boolean |
equals(ClosedInterval I)
Are intervals equal
|
boolean |
intersect(ClosedInterval I)
Is there a nonzero intersection between this interval
and the argument.
|
boolean |
membership(double x)
Is point a member of the open interval
|
java.lang.String |
toString()
Return the contents of the interval as a
String. |
containsAE, convexHull, createFromEndpoints, createFromMidpoint, equals, getMax, getMin, intersection, intersects, isBoundary, measure, midpoint, print, println, setMax, setMin, vertexCoordinatespublic ClosedInterval()
public ClosedInterval(double pt)
pt.pt - The single point contained in the intervalpublic ClosedInterval(double min,
double max)
throws MathException
min - left endpointmax - right endpointMathException - max is smaller than minpublic ClosedInterval(Interval I) throws MathException
I - interval to copyMathException - malformed interval to copypublic boolean membership(double x)
membership in class Intervalx - point to test for membershippublic boolean intersect(ClosedInterval I)
I - interval to be testedpublic boolean contains(ClosedInterval I)
I - interval under testtrue if I⊂this,
false otherwise.public boolean equals(ClosedInterval I)
I - interval object to be checked for equality