public final class BinaryExpression extends java.lang.Object implements SQLExpression<java.lang.Number>
SQLExpression
There is a factory method for generating these that can implement simple simplifications.
The equals(Object)
method is written to reflect commutative Operator
s.Modifier and Type | Field and Description |
---|---|
static Feature |
SIMPLIFY_EXPRESSION |
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.StringBuilder sb,
boolean qualify)
Add the expression to a StringBuilder
|
static SQLExpression<java.lang.Number> |
create(AppContext conn,
SQLExpression<?> a,
Operator op,
SQLExpression<?> b)
A factory method for binary
SQLExpression s. |
boolean |
equals(java.lang.Object obj) |
SQLExpression<?> |
getA() |
SQLExpression<?> |
getB() |
Operator |
getOp() |
java.util.List<PatternArgument> |
getParameters(java.util.List<PatternArgument> list)
Add parameters for this value to a list.
|
SQLFilter |
getRequiredFilter()
Get an SQLFilter required to be added to the filter set.
|
java.lang.Class<java.lang.Number> |
getTarget()
Get the type of the returned object as far as it is known.
|
int |
hashCode() |
java.lang.Number |
makeObject(java.sql.ResultSet rs,
int pos)
Extract a result of the expression from a ResultSet into an object of the specified type.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
groupingIsomorphic
addGroup, checkContentsCanGroup, getGroupParameters
public static final Feature SIMPLIFY_EXPRESSION
public static SQLExpression<java.lang.Number> create(AppContext conn, SQLExpression<?> a, Operator op, SQLExpression<?> b)
SQLExpression
s.
Usually this will return a BinaryExpression
but may return some other
expression as a result of on-the-fly simplification if the AppContext
parameter is non-null
and the appropriate feature is turned on.conn
- AppContext
used to read config, null suppresses simplificationa
- SQLExpression
first argumentop
- Operator
to applyb
- SQLExpression
second argument.SQLExpression
public int add(java.lang.StringBuilder sb, boolean qualify)
SQLValue
public java.lang.Number makeObject(java.sql.ResultSet rs, int pos) throws DataException, java.sql.SQLException
SQLValue
makeObject
in interface SQLValue<java.lang.Number>
rs
- ResultSetDataException
java.sql.SQLException
public java.lang.Class<java.lang.Number> getTarget()
Targetted
public java.lang.String toString()
toString
in class java.lang.Object
public SQLFilter getRequiredFilter()
SQLValue
getRequiredFilter
in interface SQLValue<java.lang.Number>
public java.util.List<PatternArgument> getParameters(java.util.List<PatternArgument> list)
SQLValue
getParameters
in interface SQLValue<java.lang.Number>
list
- to modifypublic int hashCode()
hashCode
in interface SQLExpression<java.lang.Number>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface SQLExpression<java.lang.Number>
equals
in class java.lang.Object
public SQLExpression<?> getA()
public SQLExpression<?> getB()
public Operator getOp()