Public Member Functions | Friends
ibis::qContinuousRange Class Reference

Simple range condition. More...

#include <qExpr.h>

Inheritance diagram for ibis::qContinuousRange:
ibis::qRange ibis::qExpr

List of all members.

Public Member Functions

virtual const char * colName () const
 Returns the name of the attribute involved.
virtual qContinuousRangedup () 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
COMPAREleftOperator ()
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
COMPARErightOperator ()

Friends

void ibis::qExpr::simplify (ibis::qExpr *&)

Detailed Description

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);
///
/// 

Constructor & Destructor Documentation

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().


Member Function Documentation

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.


The documentation for this class was generated from the following files:

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive