com.sun.labs.minion.query
Class Relation
java.lang.Object
com.sun.labs.minion.query.Element
com.sun.labs.minion.query.Relation
- Direct Known Subclasses:
- StringRelation
public class Relation
- extends Element
A class for a simple relational query, like price < 10. Such queries can
be run on any field that has the SAVED attribute. While this
class can be used for simple relations on string fields, StringRelation
provides the full set of relational operators that can be applied to string
fields.
Note that this API cannot currently check whether the field provided for the
relation is a saved field. This will be checked when the query is evaluated
and a warning provided then.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
field
protected java.lang.String field
operator
protected Relation.Operator operator
value
protected java.lang.String value
Relation
protected Relation()
Relation
public Relation(java.lang.String field,
Relation.Operator operator,
java.lang.String value)
getField
public java.lang.String getField()
getOperator
public Relation.Operator getOperator()
getValue
public java.lang.String getValue()
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