org.sqlite.event
Class CollationNeededHandler

java.lang.Object
  extended by org.sqlite.callback.Callback
      extended by org.sqlite.event.CollationNeededHandler

public class CollationNeededHandler
extends Callback

Collation Needed Callbacks class.

See Also:
Collation Needed Callbacks, JdbcConnection.setCollationNeededHandler(CollationNeededHandler), JdbcConnection.clearCollationNeededHandler()

Constructor Summary
CollationNeededHandler()
           
 
Method Summary
 Collator addCollator(Collator col)
          Appends the Collator object.
 Collator removeCollator(Collator col)
          Removes the Collator object.
 Collator removeCollator(java.lang.String name)
          Removes the Collator object.
 void setDatabase(Database db)
          Set the Database object.
WARNING! Do not use it because it is called internally.
protected  void xCollationNeeded(long pDb, int eTextRep, java.lang.String name)
          Register the desired collation sequence.
 
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
 

Constructor Detail

CollationNeededHandler

public CollationNeededHandler()
Method Detail

setDatabase

public void setDatabase(Database db)
Set the Database object.
WARNING! Do not use it because it is called internally.

Parameters:
db - the Database object

addCollator

public Collator addCollator(Collator col)
Appends the Collator object.

Parameters:
col - the Collator object
Returns:
the previous Collator object associated with collation sequence name, or null if there was no mapping for collation sequence name.

removeCollator

public Collator removeCollator(java.lang.String name)
Removes the Collator object.

Parameters:
name - the collation sequence name
Returns:
the previous Collator object associated with collation sequence name, or null if there was no mapping for collation sequence name.

removeCollator

public Collator removeCollator(Collator col)
Removes the Collator object.

Parameters:
col - the Collator object
Returns:
the previous Collator object associated with collation sequence name, or null if there was no mapping for collation sequence name.

xCollationNeeded

protected final void xCollationNeeded(long pDb,
                                      int eTextRep,
                                      java.lang.String name)
                               throws java.sql.SQLException
Register the desired collation sequence.

Parameters:
pDb - the sqlite3* value
eTextRep - the value is one of SQLITE_UTF8, SQLITE_UTF16BE, or SQLITE_UTF16LE, indicating the most desirable form of the collation sequence function required.
name - the name of the required collation sequence.
Throws:
java.sql.SQLException - When the return value of the sqlite3_create_collation() function is not SQLITE_OK.