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 int
shift
-
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 protected
FixedWidthUnicodeEncoding(java.lang.String name, int width)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
codeToMbcLength(int code)
Returns character length given a code point Oniguruma equivalent:code_to_mbclen
int[]
ctypeCodeRange(int ctype, IntHolder sbOut)
onigenc_utf16_32_get_ctype_code_rangeboolean
isReverseMatchAllowed(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_match
int
leftAdjustCharHead(byte[] bytes, int p, int s, int end)
Seeks the previous character head in a stream Oniguruma equivalent:left_adjust_char_head
int
length(byte c)
Returns character length given character head returns1
for singlebyte encodings or performs direct length table lookup for multibyte ones.int
length(byte[] bytes, int p, int e)
Returns character length given stream, character position and stream end returns1
for singlebyte encodings or performs sanity validations for multibyte ones and returns the character length, missing characters in the stream otherwiseprivate static int
log2(int n)
int
strCodeAt(byte[] bytes, int p, int end, int index)
int
strLength(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:Encoding
Returns character length given character head returns1
for singlebyte encodings or performs direct length table lookup for multibyte ones.- Overrides:
length
in classMultiByteEncoding
- Parameters:
c
- Character head Oniguruma equivalent:mbc_enc_len
To 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:Encoding
Returns character length given stream, character position and stream end returns1
for 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:
strLength
in classMultiByteEncoding
-
strCodeAt
public final int strCodeAt(byte[] bytes, int p, int end, int index)
- Overrides:
strCodeAt
in classMultiByteEncoding
-
codeToMbcLength
public final int codeToMbcLength(int code)
Description copied from class:Encoding
Returns character length given a code point Oniguruma equivalent:code_to_mbclen
- Specified by:
codeToMbcLength
in classEncoding
-
ctypeCodeRange
public final int[] ctypeCodeRange(int ctype, IntHolder sbOut)
onigenc_utf16_32_get_ctype_code_range- Specified by:
ctypeCodeRange
in classEncoding
-
leftAdjustCharHead
public final int leftAdjustCharHead(byte[] bytes, int p, int s, int end)
Description copied from class:Encoding
Seeks the previous character head in a stream Oniguruma equivalent:left_adjust_char_head
- Specified by:
leftAdjustCharHead
in classEncoding
- Parameters:
bytes
- byte streamp
- positions
- stopend
- end
-
isReverseMatchAllowed
public final boolean isReverseMatchAllowed(byte[] bytes, int p, int end)
Description copied from class:Encoding
Returns true if it's safe to use reversal Boyer-Moore search fail fast algorithm Oniguruma equivalent:is_allowed_reverse_match
- Specified by:
isReverseMatchAllowed
in classEncoding
-
log2
private static int log2(int n)
-
-