Class FixedWidthUnicodeEncoding
java.lang.Object
org.jcodings.Encoding
org.jcodings.AbstractEncoding
org.jcodings.MultiByteEncoding
org.jcodings.unicode.UnicodeEncoding
org.jcodings.unicode.FixedWidthUnicodeEncoding
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
UTF32BEEncoding, UTF32LEEncoding
-
Nested Class Summary
Nested classes/interfaces inherited from class UnicodeEncoding
UnicodeEncoding.CTypeName -
Field Summary
FieldsFields inherited from class UnicodeEncoding
CASE_MAPPING_SLACK, DOT_ABOVE, DOTLESS_i, I_WITH_DOT_ABOVE, UNICODE_ISO_8859_1_CTypeTable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intcodeToMbcLength(int code) Returns character length given a code point Oniguruma equivalent:code_to_mbclenfinal int[]ctypeCodeRange(int ctype, IntHolder sbOut) onigenc_utf16_32_get_ctype_code_rangefinal booleanisReverseMatchAllowed(byte[] bytes, int p, int end) Returns true if it's safe to use reversal Boyer-Moore search fail fast algorithm Oniguruma equivalent:is_allowed_reverse_matchfinal intleftAdjustCharHead(byte[] bytes, int p, int s, int end) Seeks the previous character head in a stream Oniguruma equivalent:left_adjust_char_headfinal intlength(byte c) Returns character length given character head returns1for singlebyte encodings or performs direct length table lookup for multibyte ones.intlength(byte[] bytes, int p, int e) Returns character length given stream, character position and stream end returns1for singlebyte encodings or performs sanity validations for multibyte ones and returns the character length, missing characters in the stream otherwiseprivate static intlog2(int n) final intstrCodeAt(byte[] bytes, int p, int end, int index) final intstrLength(byte[] bytes, int p, int end) Methods inherited from class UnicodeEncoding
applyAllCaseFold, caseFoldCodesByString, caseMap, ctypeCodeRange, getCharsetName, isCodeCType, isInCodeRange, mbcCaseFold, propertyNameToCTypeMethods inherited from class MultiByteEncoding
isInRange, lengthForTwoUptoFour, mb2CodeToMbc, mb2CodeToMbcLength, mb2IsCodeCType, mb4CodeToMbc, mb4CodeToMbcLength, mb4IsCodeCType, mbnMbcCaseFold, mbnMbcToCode, missing, missing, safeLengthForUptoFour, safeLengthForUptoThree, safeLengthForUptoTwoMethods inherited from class AbstractEncoding
asciiApplyAllCaseFold, asciiCaseFoldCodesByString, asciiMbcCaseFold, isCodeCTypeInternal, isNewLineMethods inherited from class Encoding
asciiToLower, asciiToUpper, codeToMbc, digitVal, equals, getCharset, getIndex, getName, hashCode, isAlnum, isAlpha, isAscii, isAscii, isAsciiCompatible, isBlank, isCntrl, isDigit, isDummy, isFixedWidth, isGraph, isLower, isMbcAscii, isMbcCrnl, isMbcHead, isMbcWord, isNewLine, isPrint, isPunct, isSbWord, isSingleByte, isSpace, isUnicode, isUpper, isUTF8, isWord, isWordGraphPrint, isXDigit, load, load, maxLength, maxLengthDistance, mbcodeStartPosition, mbcToCode, minLength, odigitVal, prevCharHead, rightAdjustCharHead, rightAdjustCharHeadWithPrev, setDummy, setName, setName, step, stepBack, strByteLengthNull, strLengthNull, strNCmp, toLowerCaseTable, toString, xdigitVal
-
Field Details
-
shift
protected final int shift
-
-
Constructor Details
-
FixedWidthUnicodeEncoding
-
-
Method Details
-
length
public final int length(byte c) Description copied from class:EncodingReturns character length given character head returns1for singlebyte encodings or performs direct length table lookup for multibyte ones.- Overrides:
lengthin classMultiByteEncoding- Parameters:
c- Character head Oniguruma equivalent:mbc_enc_lenTo be deprecated very soon (use length(byte[]bytes, int p, int end) version)
-
length
public int length(byte[] bytes, int p, int e) Description copied from class:EncodingReturns character length given stream, character position and stream end returns1for singlebyte encodings or performs sanity validations for multibyte ones and returns the character length, missing characters in the stream otherwise -
strLength
public final int strLength(byte[] bytes, int p, int end) - Overrides:
strLengthin classMultiByteEncoding
-
strCodeAt
public final int strCodeAt(byte[] bytes, int p, int end, int index) - Overrides:
strCodeAtin classMultiByteEncoding
-
codeToMbcLength
public final int codeToMbcLength(int code) Description copied from class:EncodingReturns character length given a code point Oniguruma equivalent:code_to_mbclen- Specified by:
codeToMbcLengthin classEncoding
-
ctypeCodeRange
onigenc_utf16_32_get_ctype_code_range- Specified by:
ctypeCodeRangein classEncoding
-
leftAdjustCharHead
public final int leftAdjustCharHead(byte[] bytes, int p, int s, int end) Description copied from class:EncodingSeeks the previous character head in a stream Oniguruma equivalent:left_adjust_char_head- Specified by:
leftAdjustCharHeadin classEncoding- Parameters:
bytes- byte streamp- positions- stopend- end
-
isReverseMatchAllowed
public final boolean isReverseMatchAllowed(byte[] bytes, int p, int end) Description copied from class:EncodingReturns true if it's safe to use reversal Boyer-Moore search fail fast algorithm Oniguruma equivalent:is_allowed_reverse_match- Specified by:
isReverseMatchAllowedin classEncoding
-
log2
private static int log2(int n)
-