|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.sql.query.AbstractValue
org.intermine.sql.query.Function
public class Function
A representation of a function in an SQL query.
| Field Summary | |
|---|---|
static int |
AVG
AVG(v) aggregate function - takes one operand. |
static int |
COALESCE
COALESCE operator - used by the precomputed tables' orderby fields. |
static int |
COUNT
COUNT(*) aggregate function - takes no operands. |
static int |
DIVIDE
DIVIDE function - takes two operands. |
static int |
LOWER
LOWER operator - takes one operand |
static int |
MAX
MAX(v) aggregate function - takes one operand. |
static int |
MIN
MIN(v) aggregate function - takes one operand. |
static int |
MINUS
MINUS function - takes two operands. |
static int |
MODULO
MODULO arithmetic function - takes two operands. |
static int |
MULTIPLY
MULTIPLY function - takes two or more operands. |
protected java.util.List<AbstractValue> |
operands
|
protected int |
operation
|
static int |
PLUS
PLUS function - takes two or more operands. |
static int |
POWER
POWER function - takes two operands. |
static int |
STDDEV
STDDEV operator - takes one operand |
static int |
STRPOS
STRPOS operator - takes two operands. |
static int |
SUBSTR
SUBSTR operator - takes two or three operands. |
static int |
SUM
SUM(v) aggregate function - takes one operand. |
static int |
TYPECAST
Type casts - takes two operands. |
static int |
UPPER
UPPER operator - takes one operand |
| Fields inherited from class org.intermine.sql.query.AbstractValue |
|---|
EQUAL, GREATER, INCOMPARABLE, LESS, NOT_EQUAL |
| Constructor Summary | |
|---|---|
Function(int operation)
Constructor for this Function object. |
|
| Method Summary | |
|---|---|
void |
add(AbstractValue obj)
Adds an operand to this Function object. |
int |
compare(AbstractValue obj,
java.util.Map<AbstractTable,AbstractTable> tableMap,
java.util.Map<AbstractTable,AbstractTable> reverseTableMap)
Compare the value of this AbstractValue with another. |
boolean |
equals(java.lang.Object obj)
Overrides Object.equals. |
java.util.List<AbstractValue> |
getOperands()
Returns the List of operands of this function. |
int |
getOperation()
Returns the operation of the function. |
java.lang.String |
getSQLString()
Returns a String representation of this Function object, suitable for forming part of an SQL query. |
int |
hashCode()
Overrides Object.hashcode. |
boolean |
isAggregate()
Returns true if this value is an aggregate function. |
| Methods inherited from class org.intermine.sql.query.AbstractValue |
|---|
greaterOrEqual, greaterThan, lessOrEqual, lessThan, notEqualTo, valueEquals |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int operation
protected java.util.List<AbstractValue> operands
public static final int COUNT
public static final int MAX
public static final int MIN
public static final int SUM
public static final int AVG
public static final int PLUS
public static final int MINUS
public static final int MULTIPLY
public static final int DIVIDE
public static final int POWER
public static final int MODULO
public static final int TYPECAST
public static final int STRPOS
public static final int SUBSTR
public static final int COALESCE
public static final int LOWER
public static final int UPPER
public static final int STDDEV
| Constructor Detail |
|---|
public Function(int operation)
operation - the operation that this Function represents
java.lang.IllegalArgumentException - if operation is not valid| Method Detail |
|---|
public void add(AbstractValue obj)
obj - the AbstractValue to add as an operand
java.lang.IllegalArgumentException - if the operation cannot handle that many operandspublic java.lang.String getSQLString()
getSQLString in interface SQLStringablegetSQLString in class AbstractValuejava.lang.IllegalStateException - if there aren't the correct number of operands for the
operation yet.public boolean equals(java.lang.Object obj)
equals in class AbstractValueobj - the Object to compare to
public int compare(AbstractValue obj,
java.util.Map<AbstractTable,AbstractTable> tableMap,
java.util.Map<AbstractTable,AbstractTable> reverseTableMap)
compare in class AbstractValueobj - an AbstractValue to compare totableMap - a mapping between tablenames of the two elementsreverseTableMap - a reverse of tableMap
public int hashCode()
hashCode in class AbstractValuepublic int getOperation()
public java.util.List<AbstractValue> getOperands()
public boolean isAggregate()
isAggregate in class AbstractValue
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||