Package xal.tools.math
Class OpenInterval
java.lang.Object
xal.tools.math.Interval
xal.tools.math.OpenInterval
- All Implemented Interfaces:
Serializable
Represents an open interval of the real line.
- Author:
- Christopher K. Allen
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor - creates the empty interval.OpenInterval(double min, double max) Initializing constructor - create a new open interval with specified endpoints.OpenInterval(Interval interval) Copy constructor - create a new open interval initialized to the argument. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAre intervals equalinthashCode()booleanIs there a nonzero intersection between this interval and the argument.booleanmembership(double x) Is point a member of the open intervaltoString()Return the contents of the interval as aString.Methods inherited from class xal.tools.math.Interval
containsAE, convexHull, createFromEndpoints, createFromMidpoint, getMax, getMin, intersection, intersects, isBoundary, isRealLine, measure, midpoint, print, println, setMax, setMin, vertexCoordinates
-
Constructor Details
-
OpenInterval
public OpenInterval()Default constructor - creates the empty interval. -
OpenInterval
Initializing constructor - create a new open interval with specified endpoints.- Parameters:
min- left endpointmax- right endpoint- Throws:
MathException- max is smaller than min
-
OpenInterval
Copy constructor - create a new open interval initialized to the argument.- Parameters:
interval- interval to copy- Throws:
MathException- malformed interval object
-
-
Method Details
-
membership
public boolean membership(double x) Is point a member of the open interval- Overrides:
membershipin classInterval- Parameters:
x- point to test for membership- Returns:
- true if x is in interval
-
intersect
Is there a nonzero intersection between this interval and the argument.- Parameters:
interval- interval to be tested- Returns:
- true if the intervals intersect
-
equals
Are intervals equal -
hashCode
public int hashCode() -
toString
Return the contents of the interval as aString. return string representation of interval
-