h2-1.4.197.jar
登录
|
com.h2database:h2:1.4.197
META-INF
org
h2
jdbc
message
expression
engine
upgrade
Driver.java
security
fulltext
api
compress
index
table
constraint
store
util
bnf
command
tools
server
mode
jdbcx
result
JdbcDriverBackwardsCompat.java
jmx
value
CompareModeDefault.java
ValueDouble.java
ValueBytes.java
Value.java
ValueString.java
ValueUuid.java
ValueTimestamp.java
ValueResultSet.java
CharsetCollator.java
DataType.java
ValueStringFixed.java
CaseInsensitiveMap.java
CompareModeIcu4J.java
ValueEnum.java
ValueFloat.java
ValueLong.java
ValueEnumBase.java
Transfer.java
ValueNull.java
CompareMode.java
ValueJavaObject.java
ValueBoolean.java
ValueGeometry.java
ValueByte.java
ValueTime.java
NullableKeyConcurrentMap.java
ValueShort.java
ValueInt.java
ValueTimestampTimeZone.java
ValueArray.java
ValueDate.java
CaseInsensitiveConcurrentMap.java
ValueStringIgnoreCase.java
ValueLobDb.java
ValueDecimal.java
ValueLob.java
schema
mvstore
CharsetCollator.java
清空
类结构
/* * Copyright 2004-2018 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (http://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.value; import java.nio.charset.
Charset
; import java.text.
CollationKey
; import java.text.
Collator
; import java.util.
Comparator
; /** * The charset collator sorts strings according to the order in the given charset. */ public class
CharsetCollator
extends
Collator
{ /** * The comparator used to compare byte arrays. */ static final
Comparator
<byte[]>
COMPARATOR
= new
Comparator
<byte[]>() { @
Override
public int
compare
(byte[]
b1
, byte[]
b2
) { int
minLength
=
Math
.
min
(
b1
.length,
b2
.length); for (int
index
= 0;
index
<
minLength
;
index
++) { int
result
=
b1
[
index
] -
b2
[
index
]; if (
result
!= 0) { return
result
; } } return
b1
.length -
b2
.length; } }; private final
Charset
charset
; public
CharsetCollator
(
Charset
charset
) { this.
charset
=
charset
; } public
Charset
getCharset
() { return
charset
; } @
Override
public int
compare
(
String
source
,
String
target
) { return
COMPARATOR
.
compare
(
toBytes
(
source
),
toBytes
(
target
)); } /** * Convert the source to bytes, using the character set. * * @param source the source * @return the bytes */ byte[]
toBytes
(
String
source
) { return
source
.
getBytes
(
charset
); } @
Override
public
CollationKey
getCollationKey
(final
String
source
) { return new
CharsetCollationKey
(
source
); } @
Override
public int
hashCode
() { return 255; } private class
CharsetCollationKey
extends
CollationKey
{
CharsetCollationKey
(
String
source
) { super(
source
); } @
Override
public int
compareTo
(
CollationKey
target
) { return
COMPARATOR
.
compare
(
toByteArray
(),
toBytes
(
target
.
getSourceString
())); } @
Override
public byte[]
toByteArray
() { return
toBytes
(
getSourceString
()); } } }
查找资源
Jre/Lib
输入类名或文件名
类结构窗口