org.sqlite.udf
Class AggregateFunction<T>

java.lang.Object
  extended by org.sqlite.callback.Callback
      extended by org.sqlite.callback.NamedCallback
          extended by org.sqlite.udf.Function
              extended by org.sqlite.udf.AggregateFunction<T>

public abstract class AggregateFunction<T>
extends Function

User-Defined aggregate function class.

See Also:
Create Or Redefine SQL Functions, JdbcConnection.createFunction(Function), JdbcConnection.dropFunction(Function), JdbcConnection.dropFunction(java.lang.String)

Field Summary
protected  java.lang.ThreadLocal<T> tls
          thraed local storage
 
Fields inherited from class org.sqlite.udf.Function
argc
 
Constructor Summary
AggregateFunction(java.lang.String name)
           
AggregateFunction(java.lang.String name, int argc)
           
 
Method Summary
protected  T get()
          Returns the value in the current thread's copy of this thread-local variable.
protected abstract  T initialValue()
          Returns the current thread's "initial value" for this thread-local variable.
protected  void remove()
          Removes the current thread's value for this thread-local variable.
protected  void set(T value)
          Sets the current thread's copy of this thread-local variable to the specified value.
protected abstract  void xFinal(Context ctx)
           
protected  void xFinal(long context)
          Called from the sqlite3_step() function.
protected  void xFunc(Context ctx)
          Called from the sqlite3_step() function.
protected abstract  void xStep(Context ctx)
           
 
Methods inherited from class org.sqlite.udf.Function
getArgumentCount, xFunc
 
Methods inherited from class org.sqlite.callback.NamedCallback
getName
 
Methods inherited from class org.sqlite.callback.Callback
isRegistered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tls

protected final java.lang.ThreadLocal<T> tls
thraed local storage

Constructor Detail

AggregateFunction

public AggregateFunction(java.lang.String name,
                         int argc)

AggregateFunction

public AggregateFunction(java.lang.String name)
Method Detail

xFunc

protected final void xFunc(Context ctx)
                    throws java.sql.SQLException
Description copied from class: Function
Called from the sqlite3_step() function.

Specified by:
xFunc in class Function
Parameters:
ctx - sqlite3_context wrapper object
Throws:
java.sql.SQLException

xFinal

protected final void xFinal(long context)
Called from the sqlite3_step() function.

Parameters:
context -

initialValue

protected abstract T initialValue()
Returns the current thread's "initial value" for this thread-local variable.

Returns:
the initial value for this thread-local
See Also:
ThreadLocal.initialValue()

get

protected T get()
Returns the value in the current thread's copy of this thread-local variable.

Returns:
the current thread's value of this thread-local
See Also:
ThreadLocal.get()

remove

protected void remove()
Removes the current thread's value for this thread-local variable.

See Also:
ThreadLocal.remove()

set

protected void set(T value)
Sets the current thread's copy of this thread-local variable to the specified value.

Parameters:
value - the value to be stored in the current thread's copy of this thread-local.
See Also:
ThreadLocal.set(Object)

xStep

protected abstract void xStep(Context ctx)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

xFinal

protected abstract void xFinal(Context ctx)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException