Class FloatingPointInterval<T extends java.lang.Number & java.lang.Comparable<T>>

  • Type Parameters:
    T - specific type of number

    public class FloatingPointInterval<T extends java.lang.Number & java.lang.Comparable<T>>
    extends java.lang.Object

    Title: Floating Point Interval

    Description: An immutable interval representation supporting the value space of floating point numbers.

    Copyright: Copyright (c) 2009

    Company: Clark & Parsia, LLC.

    Author:
    Mike Smith
    • Constructor Detail

      • FloatingPointInterval

        public FloatingPointInterval​(FloatingPointType<T> type,
                                     T point)
        Create a point interval. This is equivalent to IEEEFloatInterval(Float, Float) with arguments point,point,true,true
        Parameters:
        type -
        point - Value of point interval
      • FloatingPointInterval

        public FloatingPointInterval​(FloatingPointType<T> type,
                                     T lower,
                                     T upper)
        Create an interval.
        Parameters:
        type -
        lower - Interval _lower bound
        upper - Interval _upper bound
    • Method Detail

      • contains

        public boolean contains​(T n)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getLower

        public T getLower()
      • getUpper

        public T getUpper()
      • greater

        public FloatingPointInterval<T> greater​(T n)
        Get the subinterval greater than n
        Parameters:
        n -
        Returns:
        a new interval, formed by intersecting this interval with (n,+inf) or null if that intersection is empty
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • less

        public FloatingPointInterval<T> less​(T n)
        Get the subinterval less than n
        Parameters:
        n -
        Returns:
        a new interval, formed by intersecting this interval with (-inf,n) or null if that intersection is empty
      • size

        public java.lang.Number size()
      • valueIterator

        public java.util.Iterator<T> valueIterator()