|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ModSQL.Literal
Wrapper for literal values.
| Field Summary | |
protected int |
type
SQL type of value. |
protected Object |
value
Literal value. |
| Fields inherited from interface ModSQL.Function |
MATCH_BEGINS, MATCH_EQU, MATCH_GT, MATCH_GTE, MATCH_LT, MATCH_LTE, MATCH_NE |
| Constructor Summary | |
Literal()
Constructor for null value. |
|
Literal(boolean b)
Constructor for boolean. |
|
Literal(double d)
Constructor for double. |
|
Literal(int i)
Constructor for integer. |
|
Literal(long l)
Constructor for long. |
|
Literal(Object s)
Constructor for java object. |
|
| Method Summary | |
void |
addParameter(Function item)
Adds a parameter to the list of parameters. |
Object |
evaluate(boolean aggregate)
Returns the literal value. |
Object |
evaluate(int match_op,
Object match_value)
Returns the literal value. |
void |
evaluateOrder(int index,
int order)
Specify the order in which the parameters should be evaluated. |
int |
getMaxResultSize()
If the literal is a String, this method returns the length of the String. |
Function |
getParameter(int index)
Get a particular parameter. |
int |
getParameterCount()
Get the number of parameters. |
int |
getSQLType()
Return the SQL type of the literal value. |
boolean |
isAggregate()
Determine if this function will return a value that is an aggregate of many database rows. |
boolean |
isConstant()
Determine if this function returns a constant value. |
void |
optimize()
Does nothing. |
void |
registerWith(Object o)
Does nothing as a Literal has no parameters. |
void |
reset()
Does nothing. |
String |
toString()
Return human readable version of literal. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected Object value
protected int type
| Constructor Detail |
public Literal()
public Literal(Object s)
s - object literalpublic Literal(int i)
i - integer literalpublic Literal(long l)
l - long literalpublic Literal(double d)
d - double literalpublic Literal(boolean b)
b - boolean literal| Method Detail |
public String toString()
toString in class Objectpublic int getParameterCount()
getParameterCount in interface Functionpublic Function getParameter(int index)
getParameter in interface Functionindex - index of parameter to getIndexOutOfBoundsException - always
public void addParameter(Function item)
throws SQLException
addParameter in interface Functionitem - function to addSQLException - always
public void evaluateOrder(int index,
int order)
evaluateOrder in interface Functionindex - index of parameterorder - number indicating order in which parameter is evaluatedIndexOutOfBoundsException - alwayspublic void registerWith(Object o)
registerWith in interface Functiono - object to register withpublic void optimize()
optimize in interface FunctionModSQL.FunctionSQLException - if an error occurspublic boolean isConstant()
isConstant in interface Functionpublic boolean isAggregate()
isAggregate in interface Functionpublic int getSQLType()
getSQLType in interface Functionpublic int getMaxResultSize()
getMaxResultSize in interface Functionpublic Object evaluate(boolean aggregate)
evaluate in interface Functionaggregate - true to get final aggregate value
public Object evaluate(int match_op,
Object match_value)
evaluate in interface Functionmatch_op - how the value should be matchedmatch_value - desired valuepublic void reset()
reset in interface FunctionModSQL.FunctionSQLException - if an error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||