public static class IntegerBoundsChecker.Interval
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static IntegerBoundsChecker.Interval |
FULL
Interval representing all integers.
|
protected java.lang.Long |
lower |
static IntegerBoundsChecker.Interval |
POS
The non-negative integers (includes 0).
|
protected java.lang.Long |
upper |
Constructor and Description |
---|
Interval(java.lang.Long lower,
java.lang.Long upper) |
Modifier and Type | Method and Description |
---|---|
IntegerBoundsChecker.Interval |
add(IntegerBoundsChecker.Interval other) |
boolean |
contains(IntegerBoundsChecker.Interval other)
Returns whether this interval is a superset of the other.
|
boolean |
equals(java.lang.Object o) |
java.lang.Long |
getLower() |
java.lang.Long |
getUpper() |
int |
hashCode() |
IntegerBoundsChecker.Interval |
intersect(IntegerBoundsChecker.Interval other)
Returns the intersection of this and the other interval.
|
protected java.lang.Long |
longMult(java.lang.Long i,
java.lang.Long j) |
IntegerBoundsChecker.Interval |
multiply(IntegerBoundsChecker.Interval other) |
IntegerBoundsChecker.Interval |
shift(long i)
Returns an interval that is this one shifted by the given amount.
|
static IntegerBoundsChecker.Interval |
singleton(long i)
Returns an interval containing only one integer.
|
IntegerBoundsChecker.Interval |
subtract(IntegerBoundsChecker.Interval other) |
java.lang.String |
toString() |
IntegerBoundsChecker.Interval |
union(IntegerBoundsChecker.Interval other)
Returns the smallest interval that contains this and the other
interval.
|
public static final IntegerBoundsChecker.Interval FULL
public static final IntegerBoundsChecker.Interval POS
protected final java.lang.Long lower
protected final java.lang.Long upper
public static IntegerBoundsChecker.Interval singleton(long i)
public java.lang.Long getLower()
public java.lang.Long getUpper()
public boolean contains(IntegerBoundsChecker.Interval other)
public IntegerBoundsChecker.Interval union(IntegerBoundsChecker.Interval other)
public IntegerBoundsChecker.Interval intersect(IntegerBoundsChecker.Interval other)
public IntegerBoundsChecker.Interval shift(long i)
public IntegerBoundsChecker.Interval add(IntegerBoundsChecker.Interval other)
public IntegerBoundsChecker.Interval subtract(IntegerBoundsChecker.Interval other)
protected java.lang.Long longMult(java.lang.Long i, java.lang.Long j)
public IntegerBoundsChecker.Interval multiply(IntegerBoundsChecker.Interval other)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object