Package org.h2.value

# Class CompareModeDefault

java.lang.Object
org.h2.value.CompareMode
org.h2.value.CompareModeDefault

All Implemented Interfaces:
  `Comparator<Value>`

public class CompareModeDefault extends CompareMode
The default implementation of CompareMode. It uses java.text.Collator.

## Field Summary

### Fields inherited from class org.h2.value.CompareMode

`CHARSET, DEFAULT, ICU4J, OFF`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`CompareModeDefault(String name, int strength)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareString(String a, String b, boolean ignoreCase)`
Compare two strings.
`boolean`
`equalsChars(String a, int ai, String b, int bi, boolean ignoreCase)`
Compare two characters in a string.

### Methods inherited from class org.h2.value.CompareMode

`compare, equals, getCollationLocales, getCollator, getInstance, getName, getName, getStrength, hashCode`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.Comparator

`reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

## Constructor Details

### CompareModeDefault

protected CompareModeDefault(String name, int strength)

## Method Details

### compareString

public int compareString(String a, String b, boolean ignoreCase)
Description copied from class: `CompareMode`
Compare two strings.

Overrides:
  `compareString` in class `CompareMode`
Parameters:
  `a` - the first string
  `b` - the second string
  `ignoreCase` - 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(String a, int ai, 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 string
  `ai` - the character index in the first string
  `b` - the second string
  `bi` - the character index in the second string
  `ignoreCase` - true if a case-insensitive comparison should be made
Returns:
  true if the characters are equals