com.sun.labs.minion.query
Class Range

java.lang.Object
  extended by com.sun.labs.minion.query.Element
      extended by com.sun.labs.minion.query.Range

public class Range
extends Element

A range query. A range query can be used on a saved field and it returns all the elements whose values for the saved field fall between certain values. The end points of the range can be inclusive or exclusive, depending on the relational operators that are used to build the range.


Field Summary
 
Fields inherited from class com.sun.labs.minion.query.Element
fields, strict
 
Constructor Summary
Range(java.lang.String field, Relation.Operator leftOp, java.lang.String leftVal, Relation.Operator rightOp, java.lang.String rightVal)
          Creates a range operator.
 
Method Summary
 java.lang.String getField()
           
 Relation.Operator getLeftOperator()
           
 java.lang.String getLeftValue()
           
 QueryElement getQueryElement()
          Transduces this query element into a "real" query element, one that can be evaluated by the search engine.
 Relation.Operator getRightOperator()
           
 java.lang.String getRightValue()
           
 java.lang.String toString()
           
 
Methods inherited from class com.sun.labs.minion.query.Element
addField, getFields, getStrict, setFields, setStrict
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range(java.lang.String field,
             Relation.Operator leftOp,
             java.lang.String leftVal,
             Relation.Operator rightOp,
             java.lang.String rightVal)
Creates a range operator.

Parameters:
field - the field that we're interested in
leftOp - the operator for the left hand end of the range. Must be either Relation.Operator.GEQ or Relation.Operator.GREATER_THAN
leftVal - the value for the left hand end of the range.
rightOp - the operator for the right hand end of the range. Must be either Relation.Operator.LEQ or Relation.Operator.LESS_THAN
rightVal - the value for the right hand end of the range.
Throws:
java.lang.IllegalArgumentException - if the preconditions for the operator types and positions are not met.
Method Detail

getField

public java.lang.String getField()

getRightOperator

public Relation.Operator getRightOperator()

getLeftOperator

public Relation.Operator getLeftOperator()

getRightValue

public java.lang.String getRightValue()

getLeftValue

public java.lang.String getLeftValue()

getQueryElement

public QueryElement getQueryElement()
Description copied from class: Element
Transduces this query element into a "real" query element, one that can be evaluated by the search engine.

Specified by:
getQueryElement in class Element
Returns:
an evaluatable query element.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object