Package com.ibm.icu.charset
Class CharsetBOCU1
- java.lang.Object
-
- java.nio.charset.Charset
-
- com.ibm.icu.charset.CharsetICU
-
- com.ibm.icu.charset.CharsetBOCU1
-
- All Implemented Interfaces:
java.lang.Comparable<java.nio.charset.Charset>
class CharsetBOCU1 extends CharsetICU
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
CharsetBOCU1.CharsetDecoderBOCU
(package private) class
CharsetBOCU1.CharsetEncoderBOCU
-
Field Summary
Fields Modifier and Type Field Description private static byte
BOCU1_ASCII_PREV
private static int
BOCU1_LEAD_2
private static int
BOCU1_LEAD_3
private static int
BOCU1_MAX_TRAIL
private static int
BOCU1_MIDDLE
private static int
BOCU1_MIN
private static int
BOCU1_REACH_NEG_1
private static int
BOCU1_REACH_NEG_2
private static int
BOCU1_REACH_NEG_3
private static int
BOCU1_REACH_POS_1
private static int
BOCU1_REACH_POS_2
private static int
BOCU1_REACH_POS_3
private static int
BOCU1_RESET
private static int
BOCU1_SINGLE
private static int
BOCU1_START_NEG_2
private static int
BOCU1_START_NEG_3
private static int
BOCU1_START_POS_2
private static int
BOCU1_START_POS_3
private static int
BOCU1_START_POS_4
private static int
BOCU1_TRAIL_BYTE_OFFSET
private static int
BOCU1_TRAIL_CONTROLS_COUNT
private static int
BOCU1_TRAIL_COUNT
private static int[]
bocu1ByteToTrail
private static int[]
bocu1TrailToByte
protected byte[]
fromUSubstitution
-
Fields inherited from class com.ibm.icu.charset.CharsetICU
codepage, conversionType, hasFromUnicodeFallback, hasToUnicodeFallback, icuCanonicalName, maxBytesPerChar, maxCharsPerByte, minBytesPerChar, name, options, platform, ROUNDTRIP_AND_FALLBACK_SET, ROUNDTRIP_SET, subChar, subChar1, subCharLen, unicodeMask
-
-
Constructor Summary
Constructors Constructor Description CharsetBOCU1(java.lang.String icuCanonicalName, java.lang.String javaCanonicalName, java.lang.String[] aliases)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
BOCU1_LENGTH_FROM_PACKED(int packed)
private static int
BOCU1_PREV(int c)
Fast version of bocu1Prev() for most scripts.private static int
BOCU1_SIMPLE_PREV(int c)
private static int
BOCU1_TRAIL_TO_BYTE(int trail)
private static int
bocu1Prev(int c)
Compute the next "previous" value for differencing from the current code point.private static boolean
DIFF_IS_DOUBLE(int diff)
Is a diff value encodable in two bytes?private static boolean
DIFF_IS_SINGLE(int diff)
Is a diff value encodable in a single byte?(package private) void
getUnicodeSetImpl(UnicodeSet setFillIn, int which)
This follows ucnv.c method ucnv_detectUnicodeSignature() to detect the start of the stream for example U+FEFF (the Unicode BOM/signature character) that can be ignored.java.nio.charset.CharsetDecoder
newDecoder()
java.nio.charset.CharsetEncoder
newEncoder()
private static int
PACK_SINGLE_DIFF(int diff)
Encode a diff value in a single byte.-
Methods inherited from class com.ibm.icu.charset.CharsetICU
contains, forNameICU, getCharset, getCompleteUnicodeSet, getNonSurrogateUnicodeSet, getUnicodeSet, isFixedWidth, isSurrogate
-
-
-
-
Field Detail
-
BOCU1_ASCII_PREV
private static final byte BOCU1_ASCII_PREV
- See Also:
- Constant Field Values
-
BOCU1_MIN
private static final int BOCU1_MIN
- See Also:
- Constant Field Values
-
BOCU1_MIDDLE
private static final int BOCU1_MIDDLE
- See Also:
- Constant Field Values
-
BOCU1_MAX_TRAIL
private static final int BOCU1_MAX_TRAIL
- See Also:
- Constant Field Values
-
BOCU1_RESET
private static final int BOCU1_RESET
- See Also:
- Constant Field Values
-
BOCU1_TRAIL_CONTROLS_COUNT
private static final int BOCU1_TRAIL_CONTROLS_COUNT
- See Also:
- Constant Field Values
-
BOCU1_TRAIL_BYTE_OFFSET
private static final int BOCU1_TRAIL_BYTE_OFFSET
- See Also:
- Constant Field Values
-
BOCU1_TRAIL_COUNT
private static final int BOCU1_TRAIL_COUNT
- See Also:
- Constant Field Values
-
BOCU1_SINGLE
private static final int BOCU1_SINGLE
- See Also:
- Constant Field Values
-
BOCU1_LEAD_2
private static final int BOCU1_LEAD_2
- See Also:
- Constant Field Values
-
BOCU1_LEAD_3
private static final int BOCU1_LEAD_3
- See Also:
- Constant Field Values
-
BOCU1_REACH_POS_1
private static final int BOCU1_REACH_POS_1
- See Also:
- Constant Field Values
-
BOCU1_REACH_NEG_1
private static final int BOCU1_REACH_NEG_1
- See Also:
- Constant Field Values
-
BOCU1_REACH_POS_2
private static final int BOCU1_REACH_POS_2
- See Also:
- Constant Field Values
-
BOCU1_REACH_NEG_2
private static final int BOCU1_REACH_NEG_2
- See Also:
- Constant Field Values
-
BOCU1_REACH_POS_3
private static final int BOCU1_REACH_POS_3
- See Also:
- Constant Field Values
-
BOCU1_REACH_NEG_3
private static final int BOCU1_REACH_NEG_3
- See Also:
- Constant Field Values
-
BOCU1_START_POS_2
private static final int BOCU1_START_POS_2
- See Also:
- Constant Field Values
-
BOCU1_START_POS_3
private static final int BOCU1_START_POS_3
- See Also:
- Constant Field Values
-
BOCU1_START_POS_4
private static final int BOCU1_START_POS_4
- See Also:
- Constant Field Values
-
BOCU1_START_NEG_2
private static final int BOCU1_START_NEG_2
- See Also:
- Constant Field Values
-
BOCU1_START_NEG_3
private static final int BOCU1_START_NEG_3
- See Also:
- Constant Field Values
-
bocu1ByteToTrail
private static final int[] bocu1ByteToTrail
-
bocu1TrailToByte
private static final int[] bocu1TrailToByte
-
fromUSubstitution
protected byte[] fromUSubstitution
-
-
Method Detail
-
BOCU1_LENGTH_FROM_PACKED
private static int BOCU1_LENGTH_FROM_PACKED(int packed)
-
BOCU1_TRAIL_TO_BYTE
private static int BOCU1_TRAIL_TO_BYTE(int trail)
-
BOCU1_SIMPLE_PREV
private static int BOCU1_SIMPLE_PREV(int c)
-
bocu1Prev
private static int bocu1Prev(int c)
Compute the next "previous" value for differencing from the current code point.- Parameters:
c
- current code point, 0x3040..0xd7a3 (rest handled by macro below)- Returns:
- "previous code point" state value
-
BOCU1_PREV
private static int BOCU1_PREV(int c)
Fast version of bocu1Prev() for most scripts.
-
DIFF_IS_SINGLE
private static boolean DIFF_IS_SINGLE(int diff)
Is a diff value encodable in a single byte?
-
PACK_SINGLE_DIFF
private static int PACK_SINGLE_DIFF(int diff)
Encode a diff value in a single byte.
-
DIFF_IS_DOUBLE
private static boolean DIFF_IS_DOUBLE(int diff)
Is a diff value encodable in two bytes?
-
newDecoder
public java.nio.charset.CharsetDecoder newDecoder()
- Specified by:
newDecoder
in classjava.nio.charset.Charset
-
newEncoder
public java.nio.charset.CharsetEncoder newEncoder()
- Specified by:
newEncoder
in classjava.nio.charset.Charset
-
getUnicodeSetImpl
void getUnicodeSetImpl(UnicodeSet setFillIn, int which)
Description copied from class:CharsetICU
This follows ucnv.c method ucnv_detectUnicodeSignature() to detect the start of the stream for example U+FEFF (the Unicode BOM/signature character) that can be ignored. Detects Unicode signature byte sequences at the start of the byte stream and returns number of bytes of the BOM of the indicated Unicode charset. 0 is returned when no Unicode signature is recognized.- Specified by:
getUnicodeSetImpl
in classCharsetICU
-
-