MS Access stores text index values in a proprietary, order-preserving byte format rather than using
standard Unicode sort keys. This class implements that format for the "General Legacy" sort order
(LCID 1033, version 0). GeneralIndexCodes (Access 2010+) and General97IndexCodes
(Access 97) extend or mirror this class for their respective format variants.
INTERNATIONAL_EXTRA_PLACEHOLDER = 0x02); each accented char contributes its accent
code. Written after the terminator if any accented characters were present.CharHandler)CharHandler instance that supplies the
byte values for each of the four sections above. Handlers for code points U+0000–U+00FF are loaded
from index_codes_genleg.txt; handlers for U+0100–U+FFFF from
index_codes_ext_genleg.txt. Both files live in the Jackcess classpath resources under
DatabaseImpl#RESOURCE_PATH.
IndexData#setUnsupportedReason to be called and
the index to become read-only. Adding support for a new locale requires reverse-engineering the
MS Access byte tables for that locale and providing a new *IndexCodes class plus a
corresponding IndexData.ColumnDescriptor subclass — not using
java.text.Collator#getCollationKey , whose byte format is JVM-internal and incompatible with
the MS Access format.
GeneralIndexCodes, General97IndexCodes, IndexData#newColumnDescriptor
| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract static class | GeneralLegacyIndexCodes.
Holds the MS Access index byte-encoding information for a single Unicode character. |
| private static class | |
| private static class | |
| private static class | GeneralLegacyIndexCodes.
Extension of ByteStream which keeps track of an additional char count and the length of any "unprintable" code prefix. |
| private static class | GeneralLegacyIndexCodes.
CharHandler for Type.INTERNATIONAL |
| private static class | GeneralLegacyIndexCodes.
CharHandler for Type.INTERNATIONAL_EXT |
| private static class | GeneralLegacyIndexCodes.
CharHandler for Type.SIGNIFICANT |
| private static class | GeneralLegacyIndexCodes.
CharHandler for Type.SIMPLE |
| pack-priv abstract static class | GeneralLegacyIndexCodes.
Base for the handlers of the surrogate chars, which are computed rather than read from the codes files. |
| pack-priv static interface | GeneralLegacyIndexCodes.
Supplies the handler for a surrogate char. |
| pack-priv static enum | GeneralLegacyIndexCodes.
Enum which classifies the types of char encoding strategies used when creating text index entries. |
| private static class | GeneralLegacyIndexCodes.
CharHandler for Type.UNPRINTABLE |
| private static class | GeneralLegacyIndexCodes.
CharHandler for Type.UNPRINTABLE_EXT |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final int | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| private static final String | |
| pack-priv static final char | |
| pack-priv static final char | |
| pack-priv static final GeneralLegacyIndexCodes | |
| pack-priv static final GeneralLegacyIndexCodes. | IGNORED_CHAR_HANDLER
shared CharHandler instance for Type.IGNORED |
| pack-priv static final GeneralLegacyIndexCodes. | IGNORED_SURROGATES
the general legacy collation gives a surrogate no weight at all, so both halves of a pair are ignored |
| pack-priv static final byte | |
| pack-priv static final char | |
| pack-priv static final char | |
| pack-priv static final int | |
| private static final ThreadLocal | SURROGATE_CHAR_BUF
the surrogate char buffers are computed on the fly. |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final byte | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int | |
| private static byte[] | codesToBytes(String codes, boolean required)
Converts a string of hex encoded bytes to a byte[], optionally throwing an exception if no codes are given. |
| pack-priv GeneralLegacyIndexCodes. | |
| pack-priv static GeneralLegacyIndexCodes. | |
| pack-priv static GeneralLegacyIndexCodes. | Returns: the handlers for the rangeresource path of the codes file codesFilePath, char first char of the range firstChar, char last char of the range lastChar, GeneralLegacyIndexCodes.source of the handlers for the surrogate chars surrogatesLoads the CharHandlers for the given range of characters from the resource file with the given name, taking the handlers for the surrogate chars from the given source. |
| private static GeneralLegacyIndexCodes. | parseCodes(Map<String, GeneralLegacyIndexCodes.
Returns a CharHandler parsed from the given line from an index codes file. |
| protected static String | |
| private static boolean | trimExtraCodes(ByteUtil.
Trims any bytes in the given range off of the end of the given stream, returning whether or not there are any bytes left in the given stream after trimming. |
| private static void | writeCrazyCodes(ByteUtil.
Encode the given crazy code bytes into the given byte stream. |
| private static void | writeCrazyCodesSuffix(int numCrazyChars, ByteUtil.
Encode the suffix which follows the crazy codes into the given byte stream. |
| private static void | |
| private static void | writeExtraCodes(int charOffset, byte[] bytes, byte extraCodeModifier, GeneralLegacyIndexCodes.
Encodes the given extra code info in the given stream. |
| pack-priv void | writeNonNullIndexTextValue(Object value, ByteUtil.
Converts an index value for a text column into the entry value (which is based on a variety of nifty codes). |
| private static void | writeUnprintableCodes(int charOffset, byte[] bytes, ByteUtil.
Encodes the given unprintable char codes in the given stream. |