gov.sns.tools.math
Class ClosedInterval

java.lang.Object
  |
  +--gov.sns.tools.math.Interval
        |
        +--gov.sns.tools.math.ClosedInterval
All Implemented Interfaces:
java.io.Serializable

public class ClosedInterval
extends Interval

Represents an open interval of the real line.

See Also:
Serialized Form

Constructor Summary
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.
 
Method Summary
 boolean contains(ClosedInterval I)
           
 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.
 
Methods inherited from class gov.sns.tools.math.Interval
boundary, computeHull, equals, getMax, getMin, measure, midpoint, print, println, setMax, setMin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClosedInterval

public ClosedInterval()
Default constructor - creates a new instance of Interval with one point, the origin.


ClosedInterval

public ClosedInterval(double pt)
Initializing constructor - creates a single point (zero length) interval given by the value of the argument pt.

Parameters:
pt -

ClosedInterval

public ClosedInterval(double min,
                      double max)
Initializing constructor - create a new open interval with specified endpoints.

Parameters:
min - left endpoint
max - right endpoint

ClosedInterval

public ClosedInterval(Interval I)
Copy constructor - create a new open interval initialized to the argument.

Parameters:
I - interval to copy
Method Detail

membership

public boolean membership(double x)
Is point a member of the open interval

Parameters:
x - point to test for membership
Returns:
true if x is in interval

intersect

public boolean intersect(ClosedInterval I)
Is there a nonzero intersection between this interval and the argument.

Parameters:
I - interval to be tested
Returns:
true if the intervals intersect

contains

public boolean contains(ClosedInterval I)

equals

public boolean equals(ClosedInterval I)
Are intervals equal

Parameters:
I - interval object to be checked for equality
Returns:
true if both objects are equal as intervals

toString

public java.lang.String toString()
Return the contents of the interval as a String. return string representation of interval

Overrides:
toString in class Interval
See Also:
Object.toString()