Package org.jcodings.unicode
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:
java.lang.Cloneable
- Direct Known Subclasses:
UTF32BEEncoding,UTF32LEEncoding
public abstract class FixedWidthUnicodeEncoding extends UnicodeEncoding
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jcodings.unicode.UnicodeEncoding
UnicodeEncoding.CTypeName
-
-
Field Summary
Fields Modifier and Type Field Description protected intshift-
Fields inherited from class org.jcodings.unicode.UnicodeEncoding
CASE_MAPPING_SLACK, DOT_ABOVE, DOTLESS_i, I_WITH_DOT_ABOVE, UNICODE_ISO_8859_1_CTypeTable
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFixedWidthUnicodeEncoding(java.lang.String name, int width)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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_rangebooleanisReverseMatchAllowed(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 otherwiseprivate static intlog2(int n)intstrCodeAt(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, isInCodeRange, mbcCaseFold, propertyNameToCType
-
Methods inherited from class org.jcodings.MultiByteEncoding
isInRange, lengthForTwoUptoFour, mb2CodeToMbc, mb2CodeToMbcLength, mb2IsCodeCType, mb4CodeToMbc, mb4CodeToMbcLength, mb4IsCodeCType, mbnMbcCaseFold, mbnMbcToCode, missing, missing, safeLengthForUptoFour, safeLengthForUptoThree, safeLengthForUptoTwo
-
Methods inherited from class org.jcodings.AbstractEncoding
asciiApplyAllCaseFold, asciiCaseFoldCodesByString, asciiMbcCaseFold, isCodeCTypeInternal, isNewLine
-
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, load, maxLength, maxLengthDistance, mbcodeStartPosition, mbcToCode, minLength, odigitVal, prevCharHead, rightAdjustCharHead, rightAdjustCharHeadWithPrev, setDummy, setName, setName, step, stepBack, strByteLengthNull, strLengthNull, strNCmp, toLowerCaseTable, toString, xdigitVal
-
-
-
-
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
-
log2
private static int log2(int n)
-
-