public abstract class DiscreteInterval<T extends Number,U extends DiscreteInterval<T,U>> extends 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.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DiscreteInterval.NullSemantics |
class |
DiscreteInterval.ValueIterator |
| Modifier and Type | Field and Description |
|---|---|
protected static DiscreteInterval.NullSemantics |
GREATEST |
protected static DiscreteInterval.NullSemantics |
LEAST |
protected static DiscreteInterval.NullSemantics |
NA |
| Constructor and Description |
|---|
DiscreteInterval(T point)
Create a point interval.
|
DiscreteInterval(T lower,
T upper)
Create an interval.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUnionWith(U other) |
protected abstract U |
cast(DiscreteInterval<T,U> i) |
protected abstract int |
compare(T a,
DiscreteInterval.NullSemantics na,
T b,
DiscreteInterval.NullSemantics nb) |
boolean |
contains(T n) |
protected abstract U |
create(T lower,
T upper) |
protected abstract T |
decrement(T t) |
protected abstract boolean |
equal(T a,
T b) |
abstract boolean |
equals(Object obj) |
T |
getLower() |
T |
getUpper() |
U |
greater(T n)
Get the subinterval greater than n
|
int |
hashCode() |
protected abstract T |
increment(T t) |
U |
intersection(U that) |
boolean |
isFinite() |
U |
less(T n)
Get the subinterval less than n
|
List<U> |
remove(U other) |
abstract Number |
size() |
String |
toString() |
List<U> |
union(U other) |
protected abstract boolean |
valid(T t) |
Iterator<T> |
valueIterator() |
protected static final DiscreteInterval.NullSemantics GREATEST
protected static final DiscreteInterval.NullSemantics LEAST
protected static final DiscreteInterval.NullSemantics NA
public DiscreteInterval(T point)
#DiscreteInterval(T, T) with arguments point,pointpoint - Value of point intervalpublic boolean canUnionWith(U other)
protected abstract U cast(DiscreteInterval<T,U> i)
protected abstract int compare(T a, DiscreteInterval.NullSemantics na, T b, DiscreteInterval.NullSemantics nb)
public boolean contains(T n)
public T getLower()
public T getUpper()
public U greater(T n)
n - null if that intersection is emptypublic boolean isFinite()
public U less(T n)
n - null if that intersection is emptypublic abstract Number size()
protected abstract boolean valid(T t)
Copyright © 2019. All rights reserved.