|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.objectstore.query.Constraint
org.intermine.objectstore.query.SimpleConstraint
public class SimpleConstraint
Represents a constraint between two QueryEvaluable types. These are query elements that can be resolved to a value - fields, expressions, aggregate functions and constants. Constraint ops can be standard numeric comparison, IS_NULL, and also MATCHES for simple string pattern matching.
| Field Summary | |
|---|---|
protected static java.util.List<ConstraintOp> |
ALL_OPS
|
protected static java.util.List<ConstraintOp> |
BOOLEAN_OPS
|
protected static java.util.List<ConstraintOp> |
DATE_OPS
|
protected static java.util.List<ConstraintOp> |
NUMBER_OPS
|
protected QueryEvaluable |
qe1
|
protected QueryEvaluable |
qe2
|
protected static java.util.List<ConstraintOp> |
STRING_OPS
|
| Fields inherited from class org.intermine.objectstore.query.Constraint |
|---|
op |
| Constructor Summary | |
|---|---|
SimpleConstraint(QueryEvaluable qe1,
ConstraintOp op)
Construct a Constraint. |
|
SimpleConstraint(QueryEvaluable qe1,
ConstraintOp op,
QueryEvaluable qe2)
Construct a Constraint. |
|
| Method Summary | |
|---|---|
static boolean |
comparable(java.lang.Class<?> arg1,
java.lang.Class<?> arg2)
Check whether the two arguments are of comparable types i.e. they are of similiar type and we know how to handle that type |
boolean |
equals(java.lang.Object obj)
Test whether two SimpleConstraints are equal, overrides Object.equals() |
static java.util.List<ConstraintOp> |
fixedEnumOps(java.lang.Class<?> arg)
For an argument type which an enumerated value set, return the list of operators for which it makes sense only to provide the enumerated values and not allow the user to enter an arbitrary string. |
QueryEvaluable |
getArg1()
Returns the left argument of the constraint. |
QueryEvaluable |
getArg2()
Returns the right argument of the constraint. |
int |
hashCode()
Get the hashCode for this object overrides Object.hashCode() |
java.lang.String |
toString()
|
static boolean |
validComparison(java.lang.Class<?> arg1,
ConstraintOp op,
java.lang.Class<?> arg2)
Check whether a comparison is valid i.e. the arguments are comparable types and the the operator is permitted for those types |
static java.util.List<ConstraintOp> |
validOps(java.lang.Class<?> arg)
Return the list of valid (binary) operator codes given arguments of a specified type |
| Methods inherited from class org.intermine.objectstore.query.Constraint |
|---|
getOp, negate |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected QueryEvaluable qe1
protected QueryEvaluable qe2
protected static final java.util.List<ConstraintOp> NUMBER_OPS
protected static final java.util.List<ConstraintOp> DATE_OPS
protected static final java.util.List<ConstraintOp> STRING_OPS
protected static final java.util.List<ConstraintOp> BOOLEAN_OPS
protected static final java.util.List<ConstraintOp> ALL_OPS
| Constructor Detail |
|---|
public SimpleConstraint(QueryEvaluable qe1,
ConstraintOp op,
QueryEvaluable qe2)
qe1 - first QueryEvaluable for comparisonop - define comparison opqe2 - second QueryEvaluable for comparison
java.lang.IllegalArgumentException - if type does not correspond to a defined operation
public SimpleConstraint(QueryEvaluable qe1,
ConstraintOp op)
qe1 - first QueryEvaluable for comparisonop - define op of comparison
java.lang.IllegalArgumentException - if op does not correspond to a defined operation| Method Detail |
|---|
public QueryEvaluable getArg1()
public QueryEvaluable getArg2()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to compare with
public int hashCode()
hashCode in class java.lang.Object
public static boolean validComparison(java.lang.Class<?> arg1,
ConstraintOp op,
java.lang.Class<?> arg2)
arg1 - the first argumentop - how to compare the argumentsarg2 - the second argument
public static boolean comparable(java.lang.Class<?> arg1,
java.lang.Class<?> arg2)
arg1 - the first argumentarg2 - the second argument
public static java.util.List<ConstraintOp> validOps(java.lang.Class<?> arg)
arg - the argument type
public static java.util.List<ConstraintOp> fixedEnumOps(java.lang.Class<?> arg)
arg - the argument type
public 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 | ||||||||