com.sun.labs.minion.query
Class Range
java.lang.Object
com.sun.labs.minion.query.Element
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 inleftOp
- 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.
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