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
-
Fields inherited from class org.jcodings.AbstractEncoding
EMPTY_FOLD_CODES
-
Fields inherited from class org.jcodings.Encoding
CHAR_INVALID, charset, hashCode, isAsciiCompatible, isDummy, isFixedWidth, isSingleByte, maxLength, minLength, name, NEW_LINE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SingleByteEncoding(java.lang.String name, short[] CTypeTable, byte[] LowerCaseTable)
protected
SingleByteEncoding(java.lang.String name, short[] CTypeTable, byte[] LowerCaseTable, boolean isDummy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, caseFoldCodesByString, isCodeCTypeInternal, isNewLine, mbcCaseFold, propertyNameToCType
-
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, isUpper, isWord, isWordGraphPrint, isXDigit, load, maxLength, maxLengthDistance, mbcodeStartPosition, minLength, odigitVal, prevCharHead, replicate, rightAdjustCharHead, rightAdjustCharHeadWithPrev, setName, setName, step, stepBack, strByteLengthNull, strLengthNull, strNCmp, toLowerCaseTable, toString, xdigitVal
-
-
-
-
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)
-
mbcToCode
public int mbcToCode(byte[] bytes, int p, int end)
onigenc_single_byte_mbc_to_code
-
codeToMbcLength
public final 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
-
-