@Override public boolean equalsChars(String a, int ai, String b, int bi, boolean ignoreCase) { return compareString(a.substring(ai, ai + 1), b.substring(bi, bi + 1), ignoreCase) == 0; }
@Override public int compareString(String a, String b, boolean ignoreCase) { if (ignoreCase) { // this is locale sensitive a = a.toUpperCase(); b = b.toUpperCase(); } int comp; if (collationKeys != null) { CollationKey aKey = getKey(a); CollationKey bKey = getKey(b); comp = aKey.compareTo(bKey); } else { comp = collator.compare(a, b); } return comp; }
lastUsed = new CompareModeIcu4J(name, strength, binaryUnsigned); } else { lastUsed = new CompareModeDefault(name, strength, binaryUnsigned);
protected CompareModeDefault(String name, int strength, boolean binaryUnsigned) { super(name, strength, binaryUnsigned); collator = getCollator(name); if (collator == null) { throw DbException.throwInternalError(name); } collator.setStrength(strength); int cacheSize = SysProperties.COLLATOR_CACHE_SIZE; if (cacheSize != 0) { collationKeys = SmallLRUCache.newInstance(cacheSize); } else { collationKeys = null; } }