public abstract class ConstantRange extends Object
constants
. Instance are immutable.Constructor and Description |
---|
ConstantRange() |
Modifier and Type | Method and Description |
---|---|
abstract ConstantRange |
applyConstant(Constant c) |
abstract ConstantRange |
applyHigh(Constant c,
boolean incl)
Returns a new range with high set to the specified constant if doing so
makes the upper bound more strict.
|
abstract ConstantRange |
applyLow(Constant c,
boolean inclusive)
Returns a new range with low set to the specified constant if doing so
makes the lower bound more strict.
|
abstract Constant |
asConstant() |
abstract boolean |
contains(Constant c) |
abstract boolean |
contains(ConstantRange r) |
abstract boolean |
hasLowerBound() |
abstract boolean |
hasUpperBound() |
abstract Constant |
high()
Returns the higher bound.
|
abstract ConstantRange |
intersect(ConstantRange r) |
abstract boolean |
isConstant() |
abstract boolean |
isHighInclusive() |
abstract boolean |
isLowInclusive() |
abstract boolean |
isOverlapping(ConstantRange r) |
abstract boolean |
isValid()
Returns whether it is possible to have normal values (e.g., those other
than positive and negative infinities, etc.) lying within this range.
|
abstract boolean |
largerThan(Constant c) |
abstract double |
length() |
abstract boolean |
lessThan(Constant c) |
abstract Constant |
low()
Returns the lower bound.
|
static ConstantRange |
newInstance(Constant c) |
static ConstantRange |
newInstance(Constant low,
boolean lowIncl,
Constant high,
boolean highIncl)
Constructs a new instance.
|
String |
toString() |
abstract ConstantRange |
union(ConstantRange r) |
public static ConstantRange newInstance(Constant low, boolean lowIncl, Constant high, boolean highIncl)
DoubleConstant
s and an instance of
DoubleConstantRange
will be returned. Otherwise of the bounds are
of string types, an instance of VarcharConstantRange
will be
returned.low
- the lower bound. null
means unbound. Note that
low
and high
cannot be both
null
.lowIncl
- whether the lower bound is inclusivehigh
- the higher bound. null
means unbound. Note that
low
and high
cannot be both
null
.highIncl
- whether the higher bound is inclusivepublic static ConstantRange newInstance(Constant c)
public abstract boolean isValid()
public abstract boolean hasLowerBound()
public abstract boolean hasUpperBound()
public abstract Constant low()
automatic type
conversion
, the returned constant may have a type different from that of
the constant passed at construction time.public abstract Constant high()
automatic type
conversion
, the returned constant may have a type different from that of
the constant passed at construction time.public abstract boolean isLowInclusive()
public abstract boolean isHighInclusive()
public abstract double length()
public abstract ConstantRange applyLow(Constant c, boolean inclusive)
c
- the specified constantinclusive
- whether the constant is inclusivepublic abstract ConstantRange applyHigh(Constant c, boolean incl)
c
- the specified constantincl
- whether the constant is inclusivepublic abstract ConstantRange applyConstant(Constant c)
public abstract boolean isConstant()
public abstract Constant asConstant()
public abstract boolean contains(Constant c)
public abstract boolean lessThan(Constant c)
public abstract boolean largerThan(Constant c)
public abstract boolean isOverlapping(ConstantRange r)
public abstract boolean contains(ConstantRange r)
public abstract ConstantRange intersect(ConstantRange r)
public abstract ConstantRange union(ConstantRange r)
Copyright © 2022 VanillaDB Organization. All rights reserved.