public interface Function
class SinFunc implements SQLite.Function {
public void function(SQLite.FunctionContext fc, String args[]) {
try {
Double d = new Double(args[0]);
fc.set_result(Math.sin(d.doubleValue()));
} catch (Exception e) {
fc.set_error("sin(" + args[0] + "):" + e);
}
}
...
}
SQLite.Database db = new SQLite.Database();
db.open("db", 0);
db.create_function("sin", 1, SinFunc);
...
db.exec("select sin(1.0) from test", null);
| Modifier and Type | Method and Description |
|---|---|
void |
function(FunctionContext fc,
String[] args)
Callback for regular function.
|
void |
last_step(FunctionContext fc)
Callback for final step in aggregate function.
|
void |
step(FunctionContext fc,
String[] args)
Callback for one step in aggregate function.
|
void function(FunctionContext fc, String[] args)
fc - function's context for reporting resultargs - String array of argumentsvoid step(FunctionContext fc, String[] args)
fc - function's context for reporting resultargs - String array of argumentsvoid last_step(FunctionContext fc)
fc - function's context for reporting resultCopyright © 2014. All rights reserved.