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), JdbcConnection.dropCollationSequence(java.lang.String)

Constructor Summary
Collator(java.lang.String name)
          Create new collation sequence.
 
Method Summary
protected  int xCompare(java.lang.String str1, java.lang.String str2)
          Called from the sqlite3_step() function.
 
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
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Constructor Detail

Collator

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

Parameters:
name - the name of the new collation sequence.
Method Detail

xCompare

protected final int xCompare(java.lang.String str1,
                             java.lang.String str2)
Called from the sqlite3_step() function.

Parameters:
str1 - the first string to be compared.
str2 - the second string to be compared.
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
See Also:
Comparator.compare(Object, Object)