Package org.jcodings
Class SingleByteEncoding
- java.lang.Object
-
- org.jcodings.Encoding
-
- org.jcodings.AbstractEncoding
-
- org.jcodings.SingleByteEncoding
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
ASCIIEncoding
,CaseFoldMapEncoding
,USASCIIEncoding
public abstract class SingleByteEncoding extends AbstractEncoding
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
LowerCaseTable
static int
MAX_BYTE
-
Constructor Summary
Constructors Modifier Constructor Description protected
SingleByteEncoding(java.lang.String name, short[] CTypeTable, byte[] LowerCaseTable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
caseMap(IntHolder flagP, byte[] bytes, IntHolder pp, int end, byte[] to, int toP, int toEnd)
Oniguruma equivalent:case_map
int
codeToMbc(int code, byte[] bytes, int p)
onigenc_single_byte_code_to_mbcint
codeToMbcLength(int code)
onigenc_single_byte_code_to_mbclenint[]
ctypeCodeRange(int ctype, IntHolder sbOut)
onigenc_not_support_get_ctype_code_rangeboolean
isReverseMatchAllowed(byte[] bytes, int p, int end)
onigenc_always_true_is_allowed_reverse_matchint
leftAdjustCharHead(byte[] bytes, int p, int s, int end)
onigenc_single_byte_left_adjust_char_headint
length(byte c)
onigenc_single_byte_mbc_enc_lenint
length(byte[] bytes, int p, int end)
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 otherwiseint
mbcToCode(byte[] bytes, int p, int end)
onigenc_single_byte_mbc_to_codeint
strCodeAt(byte[] bytes, int p, int end, int index)
int
strLength(byte[] bytes, int p, int end)
-
Methods inherited from class org.jcodings.AbstractEncoding
applyAllCaseFold, asciiApplyAllCaseFold, asciiCaseFoldCodesByString, asciiMbcCaseFold, asciiOnlyCaseMap, caseFoldCodesByString, isCodeCTypeInternal, isNewLine, mbcCaseFold, propertyNameToCType, singleByteAsciiOnlyCaseMap
-
Methods inherited from class org.jcodings.Encoding
asciiToLower, asciiToUpper, digitVal, equals, getCharset, getCharsetName, getIndex, getName, hashCode, isAlnum, isAlpha, isAscii, isAscii, isAsciiCompatible, isBlank, isCntrl, isCodeCType, 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, minLength, odigitVal, prevCharHead, replicate, rightAdjustCharHead, rightAdjustCharHeadWithPrev, setDummy, setName, setName, step, stepBack, strByteLengthNull, strLengthNull, strNCmp, toLowerCaseTable, toString, xdigitVal
-
-
-
-
Field Detail
-
MAX_BYTE
public static final int MAX_BYTE
- See Also:
- Constant Field Values
-
LowerCaseTable
protected final byte[] LowerCaseTable
-
-
Method Detail
-
length
public int length(byte c)
onigenc_single_byte_mbc_enc_len
-
length
public int length(byte[] bytes, int p, int end)
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)
-
strCodeAt
public int strCodeAt(byte[] bytes, int p, int end, int index)
-
caseMap
public int caseMap(IntHolder flagP, byte[] bytes, IntHolder pp, int end, byte[] to, int toP, int toEnd)
Description copied from class:Encoding
Oniguruma equivalent:case_map
-
mbcToCode
public int mbcToCode(byte[] bytes, int p, int end)
onigenc_single_byte_mbc_to_code
-
codeToMbcLength
public int codeToMbcLength(int code)
onigenc_single_byte_code_to_mbclen- Specified by:
codeToMbcLength
in classEncoding
-
codeToMbc
public final int codeToMbc(int code, byte[] bytes, int p)
onigenc_single_byte_code_to_mbc
-
ctypeCodeRange
public final int[] ctypeCodeRange(int ctype, IntHolder sbOut)
onigenc_not_support_get_ctype_code_range- Specified by:
ctypeCodeRange
in classEncoding
-
leftAdjustCharHead
public final int leftAdjustCharHead(byte[] bytes, int p, int s, int end)
onigenc_single_byte_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)
onigenc_always_true_is_allowed_reverse_match- Specified by:
isReverseMatchAllowed
in classEncoding
-
-