com.clarkparsia.pellet.datatypes
Class FloatingPointInterval<T extends java.lang.Number & java.lang.Comparable<T>>

java.lang.Object
  extended by com.clarkparsia.pellet.datatypes.FloatingPointInterval<T>

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

Nested Class Summary
 class FloatingPointInterval.ValueIterator
           
 
Constructor Summary
FloatingPointInterval(FloatingPointType<T> type, T point)
          Create a point interval.
FloatingPointInterval(FloatingPointType<T> type, T lower, T upper)
          Create an interval.
 
Method Summary
 boolean canUnionWith(FloatingPointInterval<T> other)
           
 boolean contains(T n)
           
 boolean equals(java.lang.Object obj)
           
 T getLower()
           
 T getUpper()
           
 FloatingPointInterval<T> greater(T n)
          Get the subinterval greater than n
 int hashCode()
           
 FloatingPointInterval<T> intersection(FloatingPointInterval<T> that)
           
 FloatingPointInterval<T> less(T n)
          Get the subinterval less than n
 java.util.List<FloatingPointInterval<T>> remove(FloatingPointInterval<T> other)
           
 java.lang.Number size()
           
static
<U extends java.lang.Number & java.lang.Comparable<U>>
FloatingPointInterval<U>
unconstrained(FloatingPointType<U> type)
           
 java.util.List<FloatingPointInterval<T>> union(FloatingPointInterval<T> other)
           
 java.util.Iterator<T> valueIterator()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

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:
point - Value of point interval

FloatingPointInterval

public FloatingPointInterval(FloatingPointType<T> type,
                             T lower,
                             T upper)
Create an interval.

Parameters:
lower - Interval lower bound
upper - Interval upper bound
Method Detail

unconstrained

public static <U extends java.lang.Number & java.lang.Comparable<U>> FloatingPointInterval<U> unconstrained(FloatingPointType<U> type)

canUnionWith

public boolean canUnionWith(FloatingPointInterval<T> other)

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

intersection

public FloatingPointInterval<T> intersection(FloatingPointInterval<T> that)

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

remove

public java.util.List<FloatingPointInterval<T>> remove(FloatingPointInterval<T> other)

size

public java.lang.Number size()

union

public java.util.List<FloatingPointInterval<T>> union(FloatingPointInterval<T> other)

valueIterator

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


Copyright © 2004 Evren Sirin. All Rights Reserved.