Debian Codegraph @

lang/sql/jdbc/doc/SQLite/Function.html

raw
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.4.2_03) on Thu Feb 09 06:54:01 CET 2012 -->
6 <TITLE>
7 Function (SQLite Java Wrapper)
8 </TITLE>
9
10 <META NAME="keywords" CONTENT="SQLite.Function interface">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17 parent.document.title="Function (SQLite Java Wrapper)";
18 }
19 </SCRIPT>
20
21 </HEAD>
22
23 <BODY BGCOLOR="white" onload="windowTitle();">
24
25
26 <!-- ========= START OF TOP NAVBAR ======= -->
27 <A NAME="navbar_top"><!-- --></A>
28 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
29 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
30 <TR>
31 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
32 <A NAME="navbar_top_firstrow"><!-- --></A>
33 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
34 <TR ALIGN="center" VALIGN="top">
35 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
36 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
37 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
39 </TR>
40 </TABLE>
41 </TD>
42 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
43 </EM>
44 </TD>
45 </TR>
46
47 <TR>
48 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
49 &nbsp;<A HREF="../SQLite/Exception.html" title="class in SQLite"><B>PREV CLASS</B></A>&nbsp;
50 &nbsp;<A HREF="../SQLite/FunctionContext.html" title="class in SQLite"><B>NEXT CLASS</B></A></FONT></TD>
51 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
52 <A HREF="../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
53 &nbsp;<A HREF="Function.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
54 &nbsp;<SCRIPT type="text/javascript">
55 <!--
56 if(window==top) {
57 document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
58 }
59 //-->
60 </SCRIPT>
61 <NOSCRIPT>
62 <A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
63 </NOSCRIPT>
64
65 </FONT></TD>
66 </TR>
67 <TR>
68 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
69 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
70 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
71 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
72 </TR>
73 </TABLE>
74 <A NAME="skip-navbar_top"></A>
75 <!-- ========= END OF TOP NAVBAR ========= -->
76
77 <HR>
78 <!-- ======== START OF CLASS DATA ======== -->
79 <H2>
80 <FONT SIZE="-1">
81 SQLite</FONT>
82 <BR>
83 Interface Function</H2>
84 <HR>
85 <DL>
86 <DT>public interface <B>Function</B></DL>
87
88 <P>
89 Callback interface for SQLite's user defined functions.
90 Each callback method receives a
91 <A HREF="FunctionContext.html">FunctionContext</A> object
92 which is used to set the function result or error code.
93 <BR><BR>
94 Example:<BR>
95
96 <PRE>
97 class SinFunc implements SQLite.Function {
98 public void function(SQLite.FunctionContext fc, String args[]) {
99 try {
100 Double d = new Double(args[0]);
101 fc.set_result(Math.sin(d.doubleValue()));
102 } catch (Exception e) {
103 fc.set_error("sin(" + args[0] + "):" + e);
104 }
105 }
106 ...
107 }
108 SQLite.Database db = new SQLite.Database();
109 db.open("db", 0);
110 db.create_function("sin", 1, SinFunc);
111 ...
112 db.exec("select sin(1.0) from test", null);
113 </PRE>
114 <P>
115
116 <P>
117 <HR>
118
119 <P>
120 <!-- ======== NESTED CLASS SUMMARY ======== -->
121
122
123 <!-- =========== FIELD SUMMARY =========== -->
124
125
126 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
127
128
129 <!-- ========== METHOD SUMMARY =========== -->
130
131 <A NAME="method_summary"><!-- --></A>
132 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
133 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
134 <TD COLSPAN=2><FONT SIZE="+2">
135 <B>Method Summary</B></FONT></TD>
136 </TR>
137 <TR BGCOLOR="white" CLASS="TableRowColor">
138 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
139 <CODE>&nbsp;void</CODE></FONT></TD>
140 <TD><CODE><B><A HREF="../SQLite/Function.html#function(SQLite.FunctionContext, java.lang.String[])">function</A></B>(<A HREF="../SQLite/FunctionContext.html" title="class in SQLite">FunctionContext</A>&nbsp;fc,
141 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]&nbsp;args)</CODE>
142
143 <BR>
144 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Callback for regular function.</TD>
145 </TR>
146 <TR BGCOLOR="white" CLASS="TableRowColor">
147 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
148 <CODE>&nbsp;void</CODE></FONT></TD>
149 <TD><CODE><B><A HREF="../SQLite/Function.html#last_step(SQLite.FunctionContext)">last_step</A></B>(<A HREF="../SQLite/FunctionContext.html" title="class in SQLite">FunctionContext</A>&nbsp;fc)</CODE>
150
151 <BR>
152 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Callback for final step in aggregate function.</TD>
153 </TR>
154 <TR BGCOLOR="white" CLASS="TableRowColor">
155 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
156 <CODE>&nbsp;void</CODE></FONT></TD>
157 <TD><CODE><B><A HREF="../SQLite/Function.html#step(SQLite.FunctionContext, java.lang.String[])">step</A></B>(<A HREF="../SQLite/FunctionContext.html" title="class in SQLite">FunctionContext</A>&nbsp;fc,
158 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]&nbsp;args)</CODE>
159
160 <BR>
161 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Callback for one step in aggregate function.</TD>
162 </TR>
163 </TABLE>
164 &nbsp;
165 <P>
166
167 <!-- ============ FIELD DETAIL =========== -->
168
169
170 <!-- ========= CONSTRUCTOR DETAIL ======== -->
171
172
173 <!-- ============ METHOD DETAIL ========== -->
174
175 <A NAME="method_detail"><!-- --></A>
176 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
177 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
178 <TD COLSPAN=1><FONT SIZE="+2">
179 <B>Method Detail</B></FONT></TD>
180 </TR>
181 </TABLE>
182
183 <A NAME="function(SQLite.FunctionContext, java.lang.String[])"><!-- --></A><H3>
184 function</H3>
185 <PRE>
186 public void <B>function</B>(<A HREF="../SQLite/FunctionContext.html" title="class in SQLite">FunctionContext</A>&nbsp;fc,
187 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]&nbsp;args)</PRE>
188 <DL>
189 <DD>Callback for regular function.
190 <P>
191 <DD><DL>
192 <DT><B>Parameters:</B><DD><CODE>fc</CODE> - function's context for reporting result<DD><CODE>args</CODE> - String array of arguments</DL>
193 </DD>
194 </DL>
195 <HR>
196
197 <A NAME="last_step(SQLite.FunctionContext)"><!-- --></A><H3>
198 last_step</H3>
199 <PRE>
200 public void <B>last_step</B>(<A HREF="../SQLite/FunctionContext.html" title="class in SQLite">FunctionContext</A>&nbsp;fc)</PRE>
201 <DL>
202 <DD>Callback for final step in aggregate function.
203 <P>
204 <DD><DL>
205 <DT><B>Parameters:</B><DD><CODE>fc</CODE> - function's context for reporting result</DL>
206 </DD>
207 </DL>
208 <HR>
209
210 <A NAME="step(SQLite.FunctionContext, java.lang.String[])"><!-- --></A><H3>
211 step</H3>
212 <PRE>
213 public void <B>step</B>(<A HREF="../SQLite/FunctionContext.html" title="class in SQLite">FunctionContext</A>&nbsp;fc,
214 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]&nbsp;args)</PRE>
215 <DL>
216 <DD>Callback for one step in aggregate function.
217 <P>
218 <DD><DL>
219 <DT><B>Parameters:</B><DD><CODE>fc</CODE> - function's context for reporting result<DD><CODE>args</CODE> - String array of arguments</DL>
220 </DD>
221 </DL>
222 <!-- ========= END OF CLASS DATA ========= -->
223 <HR>
224
225
226 <!-- ======= START OF BOTTOM NAVBAR ====== -->
227 <A NAME="navbar_bottom"><!-- --></A>
228 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
229 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
230 <TR>
231 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
232 <A NAME="navbar_bottom_firstrow"><!-- --></A>
233 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
234 <TR ALIGN="center" VALIGN="top">
235 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
236 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
237 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
238 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
239 </TR>
240 </TABLE>
241 </TD>
242 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
243 </EM>
244 </TD>
245 </TR>
246
247 <TR>
248 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
249 &nbsp;<A HREF="../SQLite/Exception.html" title="class in SQLite"><B>PREV CLASS</B></A>&nbsp;
250 &nbsp;<A HREF="../SQLite/FunctionContext.html" title="class in SQLite"><B>NEXT CLASS</B></A></FONT></TD>
251 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
252 <A HREF="../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
253 &nbsp;<A HREF="Function.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
254 &nbsp;<SCRIPT type="text/javascript">
255 <!--
256 if(window==top) {
257 document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
258 }
259 //-->
260 </SCRIPT>
261 <NOSCRIPT>
262 <A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
263 </NOSCRIPT>
264
265 </FONT></TD>
266 </TR>
267 <TR>
268 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
269 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
270 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
271 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
272 </TR>
273 </TABLE>
274 <A NAME="skip-navbar_bottom"></A>
275 <!-- ======== END OF BOTTOM NAVBAR ======= -->
276
277 <HR>
278 <small>Contact: <a HREF="mailto:[email protected]">Christian Werner</a></small>
279 </BODY>
280 </HTML>