|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object relop.Predicate
public class Predicate
Internal representation of simple SQL expressions. Operators are referenced by constants in global.AttrOperator, and operands can be constants or field numbers (i.e. if referring to an attribute).
Constructor Summary | |
---|---|
Predicate(int oper,
int ltype,
java.lang.Object left,
int rtype,
java.lang.Object right)
Constructs a predicate, given the expression. |
Method Summary | |
---|---|
boolean |
evaluate(Tuple tuple)
Evaluates the predicate on the given tuple and returns true if it passes. |
java.lang.String |
toString()
Returns a string representation of the Predicate. |
boolean |
validate(Schema schema)
Validates AttrType.COLNAME operands against the given schema. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Predicate(int oper, int ltype, java.lang.Object left, int rtype, java.lang.Object right)
oper
- AttrOperator constantltype
- AttrType of the fieldleft
- operand value, field number, or column namertype
- AttrType of the fieldright
- operand value, field number, or column nameMethod Detail |
---|
public boolean validate(Schema schema)
public boolean evaluate(Tuple tuple)
java.lang.IllegalStateException
- if member data lead to an invalid operationpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |