org.sqlite.text
Class Collator

java.lang.Object
  extended by org.sqlite.callback.Callback
      extended by org.sqlite.callback.NamedCallback
          extended by org.sqlite.text.Collator
All Implemented Interfaces:
java.util.Comparator<java.lang.String>

public abstract class Collator
extends NamedCallback
implements java.util.Comparator<java.lang.String>

User-Defined Collating Sequence class.

See Also:
Define New Collating Sequences, JdbcConnection.createCollationSequence(org.sqlite.text.Collator), JdbcConnection.dropCollationSequence(org.sqlite.text.Collator)

Constructor Summary
Collator(java.lang.String name)
          Create new collation sequence with SQLITE_UTF8.
Collator(java.lang.String name, int enc)
          Create new collation sequence.
 
Method Summary
 void register(SWIGTYPE_p_sqlite3 db)
          invoke sqlite3_create_collation_v2() function and this object is registered in the database.
WARNING! Do not use this method because it is called internally.
 void unregister(SWIGTYPE_p_sqlite3 db)
          Unregister this object from the database.
WARNING! Do not use this method because it is called internally.
 
Methods inherited from class org.sqlite.callback.NamedCallback
getEncoding, getName
 
Methods inherited from class org.sqlite.callback.Callback
delete, isRegistered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Constructor Detail

Collator

public Collator(java.lang.String name)
Create new collation sequence with SQLITE_UTF8.

Parameters:
name - the name of the new collation sequence.
See Also:
NamedCallback.NamedCallback(java.lang.String)

Collator

public Collator(java.lang.String name,
                int enc)
Create new collation sequence.

Parameters:
name - the name of the new collation sequence.
enc - the most desirable encoding may be one of the constants SQLITE_UTF8, SQLITE_UTF16LE, SQLITE_UTF16BE or SQLITE_UTF16_ALIGNED.
See Also:
Text Encodings, NamedCallback.NamedCallback(java.lang.String, int)
Method Detail

register

public void register(SWIGTYPE_p_sqlite3 db)
              throws java.sql.SQLException
invoke sqlite3_create_collation_v2() function and this object is registered in the database.
WARNING! Do not use this method because it is called internally.

Specified by:
register in class Callback
Parameters:
db - the database handle.
Throws:
java.sql.SQLException - When the return value of the sqlite3_create_collation_v2() function is not SQLITE_OK.
See Also:
Database.createCollationSequence(Collator)

unregister

public void unregister(SWIGTYPE_p_sqlite3 db)
                throws java.sql.SQLException
Unregister this object from the database.
WARNING! Do not use this method because it is called internally.

Specified by:
unregister in class Callback
Parameters:
db - the database handle.
Throws:
java.sql.SQLException - When the return value of the sqlite3_create_collation() function is not SQLITE_OK.
See Also:
Database.dropCollationSequence(Collator)