Simple range condition. More...
#include <qExpr.h>
Public Member Functions | |
| virtual const char * | colName () const |
| Returns the name of the attribute involved. | |
| virtual qContinuousRange * | dup () const |
| Duplicate *this. | |
| virtual bool | empty () const |
| Is the current range empty? | |
| void | foldBoundaries () |
| void | foldUnsignedBoundaries () |
| virtual bool | inRange (double val) const |
| Is val in the specified range? Return true if the incoming value is in the specified range. | |
| virtual double | leftBound () const |
| The lower bound of the range. | |
| double & | leftBound () |
| COMPARE | leftOperator () const |
| COMPARE & | leftOperator () |
| bool | operator< (const qContinuousRange &y) const |
| An operator for comparing two query expressions. | |
| bool | overlap (double, double) const |
| virtual void | print (std::ostream &) const |
| Print out the node in the string form. | |
| virtual void | printFull (std::ostream &out) const |
| Print out the full expression. | |
| qContinuousRange () | |
| Construct an empty range expression. | |
| qContinuousRange (const char *lstr, COMPARE lop, const char *prop, COMPARE rop, const char *rstr) | |
| Construct a range expression from strings. | |
| qContinuousRange (const char *col, COMPARE op, uint32_t val) | |
| Construct a range expression with an integer boundary. | |
| qContinuousRange (const qContinuousRange &rhs) | |
| Copy constructor. | |
| qContinuousRange (double lv, COMPARE lop, const char *prop, COMPARE rop, double rv) | |
| Construct a range expression from double-precision boundaries. | |
| qContinuousRange (const char *prop, COMPARE op, double val) | |
| Construct a one-side range expression. | |
| virtual void | restrictRange (double left, double right) |
| Reduce the range to be no more than [left, right]. | |
| virtual double | rightBound () const |
| The upper bound of the range. | |
| double & | rightBound () |
| COMPARE | rightOperator () const |
| COMPARE & | rightOperator () |
Friends | |
| void | ibis::qExpr::simplify (ibis::qExpr *&) |
Simple range condition.
It is implemented as a derived class of qExpr. Possible range operator are defined in ibis::qExpr::COMPARE. It is designed to expression equality conditions, one-sided range conditions and two-sided range conditions.
///
/// /* an equality expression */
/// ibis::qExpr *expr = new ibis::qContinuousRange("a", ibis::qExpr::OP_EQ, 5.0);
/// /* a one-sided range expression */
/// ibis::qExpr *expr = new ibis::qContinuousRange("a", ibis::qExpr::OP_GE, 1.3);
/// /* a two-sided range expression */
/// ibis::qExpr *expr = new ibis::qContinuousRange(3.6, ibis::qExpr::OP_LE,
/// "a", ibis::qExpr::OP_LT, 4.7);
///
/// | ibis::qContinuousRange::qContinuousRange | ( | const char * | lstr, |
| qExpr::COMPARE | lop, | ||
| const char * | prop, | ||
| qExpr::COMPARE | rop, | ||
| const char * | rstr | ||
| ) |
Construct a range expression from strings.
Construct a qRange directly from a string representation of the constants.
References ibis::gVerbose, and ibis::util::incrDouble().
| bool ibis::qContinuousRange::inRange | ( | double | val | ) | const [virtual] |
Is val in the specified range? Return true if the incoming value is in the specified range.
Implements ibis::qRange.
Referenced by ibis::bin::mergeValues(), and ibis::qExpr::simplify().
| bool ibis::qContinuousRange::operator< | ( | const qContinuousRange & | y | ) | const [inline] |
An operator for comparing two query expressions.
The comparison is based on the name first, then the left bound and then the right bound.
References colName().
| void ibis::qContinuousRange::print | ( | std::ostream & | out | ) | const [virtual] |
Print out the node in the string form.
The short-form of the print function.
It only prints information about the current node of the query expression tree.
Reimplemented from ibis::qExpr.
| void ibis::qContinuousRange::printFull | ( | std::ostream & | out | ) | const [virtual] |
Print out the full expression.
The long form of the print function.
It recursively prints out the whole query expression tree, which can be quite long.
Reimplemented from ibis::qExpr.
|
| |