Package openllet.core.datatypes
Class FloatingPointInterval<T extends java.lang.Number & java.lang.Comparable<T>>
- java.lang.Object
-
- openllet.core.datatypes.FloatingPointInterval<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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
FloatingPointInterval.ValueIterator
-
Constructor Summary
Constructors Constructor Description FloatingPointInterval(FloatingPointType<T> type, T point)
Create a point interval.FloatingPointInterval(FloatingPointType<T> type, T lower, T upper)
Create an interval.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 nint
hashCode()
FloatingPointInterval<T>
intersection(FloatingPointInterval<T> that)
FloatingPointInterval<T>
less(T n)
Get the subinterval less than njava.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()
-
-
-
Constructor Detail
-
FloatingPointInterval
public FloatingPointInterval(FloatingPointType<T> type, T point)
Create a point interval. This is equivalent to IEEEFloatInterval(Float, Float) with argumentspoint,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 boundupper
- 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 classjava.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 classjava.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()
-
-