org.h2.value
Class CompareModeDefault
java.lang.Object
org.h2.value.CompareMode
org.h2.value.CompareModeDefault
public class CompareModeDefault
- extends CompareMode
The default implementation of CompareMode. It uses java.text.Collator.
Method Summary |
int |
compareString(java.lang.String a,
java.lang.String b,
boolean ignoreCase)
Compare two strings. |
boolean |
equalsChars(java.lang.String a,
int ai,
java.lang.String b,
int bi,
boolean ignoreCase)
Compare two characters in a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompareModeDefault
protected CompareModeDefault(java.lang.String name,
int strength)
compareString
public int compareString(java.lang.String a,
java.lang.String b,
boolean ignoreCase)
- Description copied from class:
CompareMode
- Compare two strings.
- Overrides:
compareString
in class CompareMode
- Parameters:
a
- the first stringb
- the second stringignoreCase
- true if a case-insensitive comparison should be made
- Returns:
- -1 if the first string is 'smaller', 1 if the second string is
smaller, and 0 if they are equal
equalsChars
public boolean equalsChars(java.lang.String a,
int ai,
java.lang.String b,
int bi,
boolean ignoreCase)
- Description copied from class:
CompareMode
- Compare two characters in a string.
- Overrides:
equalsChars
in class CompareMode
- Parameters:
a
- the first stringai
- the character index in the first stringb
- the second stringbi
- the character index in the second stringignoreCase
- true if a case-insensitive comparison should be made
- Returns:
- true if the characters are equals