Top Fields Constructors Methods
org.jcodings

public abstract Class SingleByteEncoding

extends AbstractEncoding
Class Inheritance
Known Direct Subclasses
org.jcodings.specific.ASCIIEncoding, org.jcodings.specific.USASCIIEncoding, org.jcodings.CaseFoldMapEncoding
Imports
org.jcodings.exception.ErrorCodes

Field Summary

Modifier and TypeField and Description
protected final byte[]
public static final int

Constructor Summary

AccessConstructor and Description
protected
SingleByteEncoding(String name, short[] CTypeTable, byte[] LowerCaseTable)

Method Summary

Modifier and TypeMethod and Description
public int
caseMap(IntHolder flagP, byte[] bytes, IntHolder pp, int end, byte[] to, int toP, int toEnd)

Implements abstract org.jcodings.Encoding.caseMap.

Oniguruma equivalent: case_map
public final int
codeToMbc(int code, byte[] bytes, int p)

Implements abstract org.jcodings.Encoding.codeToMbc.

onigenc_single_byte_code_to_mbc
public int
codeToMbcLength(int code)

Implements abstract org.jcodings.Encoding.codeToMbcLength.

onigenc_single_byte_code_to_mbclen
public final int[]
ctypeCodeRange(int ctype, IntHolder sbOut)

Implements abstract org.jcodings.Encoding.ctypeCodeRange.

onigenc_not_support_get_ctype_code_range
public final boolean
isReverseMatchAllowed(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.isReverseMatchAllowed.

onigenc_always_true_is_allowed_reverse_match
public final int
leftAdjustCharHead(byte[]
byte stream
bytes
,
int
position
p
,
int
stop
s
,
int
end
end
)

Implements abstract org.jcodings.Encoding.leftAdjustCharHead.

onigenc_single_byte_left_adjust_char_head
public int
length(byte
Character head Oniguruma equivalent: mbc_enc_len To be deprecated very soon (use length(byte[]bytes, int p, int end) version)
c
)

Implements abstract org.jcodings.Encoding.length.

onigenc_single_byte_mbc_enc_len
public int
length(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.length.

Returns character length given stream, character position and stream end returns 1 for singlebyte encodings or performs sanity validations for multibyte ones and returns the character length, missing characters in the stream otherwise
public int
mbcToCode(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.mbcToCode.

onigenc_single_byte_mbc_to_code
public int
strCodeAt(byte[] bytes, int p, int end, int index)

Implements abstract org.jcodings.Encoding.strCodeAt.

public final int
strLength(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.strLength.

Inherited from org.jcodings.AbstractEncoding:
applyAllCaseFoldasciiApplyAllCaseFoldasciiCaseFoldCodesByStringasciiMbcCaseFoldasciiOnlyCaseMapcaseFoldCodesByStringisCodeCTypeInternalisNewLinembcCaseFoldpropertyNameToCTypesingleByteAsciiOnlyCaseMap

Field Detail

LowerCaseTableback to summary
protected final byte[] LowerCaseTable
MAX_BYTEback to summary
public static final int MAX_BYTE

Constructor Detail

SingleByteEncodingback to summary
protected SingleByteEncoding(String name, short[] CTypeTable, byte[] LowerCaseTable)

Method Detail

caseMapback to summary
public int caseMap(IntHolder flagP, byte[] bytes, IntHolder pp, int end, byte[] to, int toP, int toEnd)

Implements abstract org.jcodings.Encoding.caseMap.

Doc from org.jcodings.Encoding.caseMap.

Oniguruma equivalent: case_map

Annotations
@Override
codeToMbcback to summary
public final int codeToMbc(int code, byte[] bytes, int p)

Implements abstract org.jcodings.Encoding.codeToMbc.

onigenc_single_byte_code_to_mbc

Returns:int

Doc from org.jcodings.Encoding.codeToMbc.

character length for the given code point Oniguruma equivalent: code_to_mbc

Annotations
@Override
codeToMbcLengthback to summary
public int codeToMbcLength(int code)

Implements abstract org.jcodings.Encoding.codeToMbcLength.

onigenc_single_byte_code_to_mbclen

Annotations
@Override
ctypeCodeRangeback to summary
public final int[] ctypeCodeRange(int ctype, IntHolder sbOut)

Implements abstract org.jcodings.Encoding.ctypeCodeRange.

onigenc_not_support_get_ctype_code_range

Annotations
@Override
isReverseMatchAllowedback to summary
public final boolean isReverseMatchAllowed(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.isReverseMatchAllowed.

onigenc_always_true_is_allowed_reverse_match

Annotations
@Override
leftAdjustCharHeadback to summary
public final int leftAdjustCharHead(byte[] bytes, int p, int s, int end)

Implements abstract org.jcodings.Encoding.leftAdjustCharHead.

onigenc_single_byte_left_adjust_char_head

Parameters
bytes:byte[]

Doc from org.jcodings.Encoding.leftAdjustCharHead.

byte stream

p:int

Doc from org.jcodings.Encoding.leftAdjustCharHead.

position

s:int

Doc from org.jcodings.Encoding.leftAdjustCharHead.

stop

end:int

Doc from org.jcodings.Encoding.leftAdjustCharHead.

end

Annotations
@Override
lengthback to summary
public int length(byte c)

Implements abstract org.jcodings.Encoding.length.

onigenc_single_byte_mbc_enc_len

Parameters
c:byte

Doc from org.jcodings.Encoding.length.

Character head Oniguruma equivalent: mbc_enc_len To be deprecated very soon (use length(byte[]bytes, int p, int end) version)

Annotations
@Override
lengthback to summary
public int length(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.length.

Doc from org.jcodings.Encoding.length.

Returns character length given stream, character position and stream end returns 1 for singlebyte encodings or performs sanity validations for multibyte ones and returns the character length, missing characters in the stream otherwise

Returns:int

0 Never > 0 Valid character, length returned -1 Illegal/malformed character < -1 (-1 - n) Number of missing bytes for character in p...end range Oniguruma equivalent: mbc_enc_len modified for 1.9 purposes,

Annotations
@Override
mbcToCodeback to summary
public int mbcToCode(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.mbcToCode.

onigenc_single_byte_mbc_to_code

Annotations
@Override
strCodeAtback to summary
public int strCodeAt(byte[] bytes, int p, int end, int index)

Implements abstract org.jcodings.Encoding.strCodeAt.

Annotations
@Override
strLengthback to summary
public final int strLength(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.strLength.

Annotations
@Override