com.clarkparsia.pellet.datatypes
Class DiscreteInterval<T extends java.lang.Number,U extends DiscreteInterval<T,U>>

java.lang.Object
  extended by com.clarkparsia.pellet.datatypes.DiscreteInterval<T,U>
Direct Known Subclasses:
FloatingPointInterval, IntegerInterval

public abstract class DiscreteInterval<T extends java.lang.Number,U extends DiscreteInterval<T,U>>
extends java.lang.Object

Title: Discrete Interval

Description: An abstract base class interval representation of discrete value spaces. Instances are immutable.

Copyright: Copyright (c) 2009

Company: Clark & Parsia, LLC.

Author:
Mike Smith

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

Constructor Detail

DiscreteInterval

public DiscreteInterval(T point)
Create a point interval. This is equivalent to #DiscreteInterval(T, T) with arguments point,point

Parameters:
point - Value of point interval

DiscreteInterval

public DiscreteInterval(T lower,
                        T upper)
Create an interval.

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

canUnionWith

public boolean canUnionWith(U other)

contains

public boolean contains(T n)

equals

public abstract boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getLower

public T getLower()

getUpper

public T getUpper()

greater

public U 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 U intersection(U that)

isFinite

public boolean isFinite()

less

public U 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<U> remove(U other)

size

public abstract java.lang.Number size()

union

public java.util.List<U> union(U other)

valueIterator

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004 Evren Sirin. All Rights Reserved.