Class OpenInterval

java.lang.Object
xal.tools.math.Interval
xal.tools.math.OpenInterval
All Implemented Interfaces:
Serializable

public class OpenInterval extends Interval
Represents an open interval of the real line.
Author:
Christopher K. Allen
See Also:
  • Constructor Details

    • OpenInterval

      public OpenInterval()
      Default constructor - creates the empty interval.
    • OpenInterval

      public OpenInterval(double min, double max) throws MathException
      Initializing constructor - create a new open interval with specified endpoints.
      Parameters:
      min - left endpoint
      max - right endpoint
      Throws:
      MathException - max is smaller than min
    • OpenInterval

      public OpenInterval(Interval interval) throws MathException
      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:
      membership in class Interval
      Parameters:
      x - point to test for membership
      Returns:
      true if x is in interval
    • intersect

      public boolean intersect(Interval interval)
      Is there a nonzero intersection between this interval and the argument.
      Parameters:
      interval - interval to be tested
      Returns:
      true if the intervals intersect
    • equals

      public boolean equals(Object obj)
      Are intervals equal
      Overrides:
      equals in class Interval
      Parameters:
      I - interval object to be checked for equality
      Returns:
      true if both objects are equal as intervals
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Interval
    • toString

      public String toString()
      Return the contents of the interval as a String. return string representation of interval
      Overrides:
      toString in class Interval
      See Also: