- java.lang.Object
-
- org.jcodings.Encoding
-
- org.jcodings.MultiByteEncoding
-
- org.jcodings.unicode.UnicodeEncoding
-
- org.jcodings.unicode.FixedWidthUnicodeEncoding
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
UTF32BEEncoding,UTF32LEEncoding
public abstract class FixedWidthUnicodeEncoding extends UnicodeEncoding
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFixedWidthUnicodeEncoding(String name, int width)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidasciiApplyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg)protected CaseFoldCodeItem[]asciiCaseFoldCodesByString(int flag, byte[] bytes, int p, int end)protected intasciiMbcCaseFold(int flag, byte[] bytes, IntHolder pp, int end, byte[] lower)intcodeToMbcLength(int code)Returns character length given a code point Oniguruma equivalent:code_to_mbclenint[]ctypeCodeRange(int ctype, IntHolder sbOut)onigenc_utf16_32_get_ctype_code_rangeprotected booleanisCodeCTypeInternal(int code, int ctype)ONIGENC_IS_XXXXXX_CODE_CTYPEbooleanisNewLine(byte[] bytes, int p, int end)onigenc_is_mbc_newline_0x0a / used also by multibyte encodingsbooleanisReverseMatchAllowed(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_matchintleftAdjustCharHead(byte[] bytes, int p, int s, int end)Seeks the previous character head in a stream Oniguruma equivalent:left_adjust_char_headintlength(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 otherwiseintstrCodeAt(byte[] bytes, int p, int end, int index)intstrLength(byte[] bytes, int p, int end)-
Methods inherited from class org.jcodings.unicode.UnicodeEncoding
applyAllCaseFold, caseFoldCodesByString, caseMap, ctypeCodeRange, getCharsetName, isCodeCType, mbcCaseFold, propertyNameToCType
-
Methods inherited from class org.jcodings.MultiByteEncoding
lengthForTwoUptoFour, mb2CodeToMbc, mb2CodeToMbcLength, mb2IsCodeCType, mb4CodeToMbc, mb4CodeToMbcLength, mb4IsCodeCType, mbnMbcCaseFold, mbnMbcToCode, missing, missing, safeLengthForUptoFour, safeLengthForUptoThree, safeLengthForUptoTwo
-
Methods inherited from class org.jcodings.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, maxLength, maxLengthDistance, mbcodeStartPosition, mbcToCode, minLength, odigitVal, prevCharHead, rightAdjustCharHead, rightAdjustCharHeadWithPrev, setDummy, setName, setName, step, stepBack, strByteLengthNull, strLengthNull, strNCmp, toLowerCaseTable, toString, xdigitVal
-
-
-
-
Constructor Detail
-
FixedWidthUnicodeEncoding
protected FixedWidthUnicodeEncoding(String name, int width)
-
-
Method Detail
-
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
public final int[] ctypeCodeRange(int ctype, IntHolder sbOut)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
-
isCodeCTypeInternal
protected final boolean isCodeCTypeInternal(int code, int ctype)ONIGENC_IS_XXXXXX_CODE_CTYPE
-
isNewLine
public boolean isNewLine(byte[] bytes, int p, int end)onigenc_is_mbc_newline_0x0a / used also by multibyte encodings
-
asciiMbcCaseFold
protected final int asciiMbcCaseFold(int flag, byte[] bytes, IntHolder pp, int end, byte[] lower)
-
asciiApplyAllCaseFold
protected final void asciiApplyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg)
-
asciiCaseFoldCodesByString
protected final CaseFoldCodeItem[] asciiCaseFoldCodesByString(int flag, byte[] bytes, int p, int end)
-
-