Top Fields Constructors Methods
org.jcodings.specific

pack-priv abstract Class BaseSJISEncoding

extends CanBeTrailTableEncoding
Class Inheritance
Known Direct Subclasses
org.jcodings.specific.NonStrictSJISEncoding, org.jcodings.specific.SJISEncoding, org.jcodings.specific.Windows_31JEncoding
Imports
org.jcodings.CanBeTrailTableEncoding, .CodeRange, .IntHolder, org.jcodings.ascii.AsciiTables, org.jcodings.constants.CharacterType, org.jcodings.exception.ErrorCodes, .ErrorMessages, .InternalException, org.jcodings.util.BytesHash

Field Summary

Modifier and TypeField and Description
private static final int[]
private static final int[]
private static final BytesHash<Integer>
private static final int[][]
pack-priv static final boolean[]
pack-priv static final int[]
Inherited from org.jcodings.CanBeTrailTableEncoding:
CanBeTrailTable

Constructor Summary

AccessConstructor and Description
protected
BaseSJISEncoding(String name, int[][] Trans)

Method Summary

Modifier and TypeMethod and Description
public int
codeToMbc(int code, byte[] bytes, int p)

Implements abstract org.jcodings.Encoding.codeToMbc.

Extracts code point into it's multibyte representation
public int
codeToMbcLength(int code)

Implements abstract org.jcodings.Encoding.codeToMbcLength.

Returns character length given a code point Oniguruma equivalent: code_to_mbclen
public int[]
ctypeCodeRange(int ctype, IntHolder sbOut)

Implements abstract org.jcodings.Encoding.ctypeCodeRange.

Returns code range for a given character type Oniguruma equivalent: get_ctype_code_range
public String
getCharsetName()

Overrides org.jcodings.Encoding.getCharsetName.

The name of the equivalent Java Charset for this encoding.
private static int
getLowerCase(int code)

public boolean
isCodeCType(int
a code point of a character
code
,
int
a character type to check against Oniguruma equivalent: is_code_ctype
ctype
)

Implements abstract org.jcodings.Encoding.isCodeCType.

Perform a check whether given code is of given character type (e.g. used by isWord(someByte) and similar methods)
public int
mbcCaseFold(int
case fold flag
flag
,
byte[] bytes, IntHolder
an IntHolder that points at character head
pp
,
int end, byte[]
a buffer where to extract case folded character Oniguruma equivalent: mbc_case_fold
lower
)

Overrides org.jcodings.AbstractEncoding.mbcCaseFold.

onigenc_ascii_mbc_case_fold
public int
mbcToCode(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.mbcToCode.

Returns code point for a character Oniguruma equivalent: mbc_to_code
public int
propertyNameToCType(byte[] bytes, int p, int end)

Overrides org.jcodings.AbstractEncoding.propertyNameToCType.

onigenc_minimum_property_name_to_ctype notably overridden by unicode encodings
private static boolean
SJIS_ISMB_TRAIL(int code)

Inherited from org.jcodings.CanBeTrailTableEncoding:
isReverseMatchAllowedleftAdjustCharHead

Field Detail

CR_Hiraganaback to summary
private static final int[] CR_Hiragana
CR_Katakanaback to summary
private static final int[] CR_Katakana
CTypeNameHashback to summary
private static final BytesHash<Integer> CTypeNameHash
PropertyListback to summary
private static final int[][] PropertyList
SJIS_CAN_BE_TRAIL_TABLEback to summary
pack-priv static final boolean[] SJIS_CAN_BE_TRAIL_TABLE
SjisEncLenback to summary
pack-priv static final int[] SjisEncLen

Constructor Detail

BaseSJISEncodingback to summary
protected BaseSJISEncoding(String name, int[][] Trans)

Method Detail

codeToMbcback to summary
public int codeToMbc(int code, byte[] bytes, int p)

Implements abstract org.jcodings.Encoding.codeToMbc.

Doc from org.jcodings.Encoding.codeToMbc.

Extracts code point into it's multibyte representation

Returns:int

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.

Doc from org.jcodings.Encoding.codeToMbcLength.

Returns character length given a code point Oniguruma equivalent: code_to_mbclen

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

Implements abstract org.jcodings.Encoding.ctypeCodeRange.

Doc from org.jcodings.Encoding.ctypeCodeRange.

Returns code range for a given character type Oniguruma equivalent: get_ctype_code_range

Annotations
@Override
getCharsetNameback to summary
public String getCharsetName()

Overrides org.jcodings.Encoding.getCharsetName.

Doc from org.jcodings.Encoding.getCharsetName.

The name of the equivalent Java Charset for this encoding. Defaults to the name of the encoding. Subclasses can override this to provide a different name.

Returns:String

the name of the equivalent Java Charset for this encoding

Annotations
@Override
getLowerCaseback to summary
private static int getLowerCase(int code)
isCodeCTypeback to summary
public boolean isCodeCType(int code, int ctype)

Implements abstract org.jcodings.Encoding.isCodeCType.

Doc from org.jcodings.Encoding.isCodeCType.

Perform a check whether given code is of given character type (e.g. used by isWord(someByte) and similar methods)

Parameters
code:int

a code point of a character

ctype:int

a character type to check against Oniguruma equivalent: is_code_ctype

Annotations
@Override
mbcCaseFoldback to summary
public int mbcCaseFold(int flag, byte[] bytes, IntHolder pp, int end, byte[] lower)

Overrides org.jcodings.AbstractEncoding.mbcCaseFold.

Doc from org.jcodings.AbstractEncoding.mbcCaseFold.

onigenc_ascii_mbc_case_fold

Parameters
flag:int

Doc from org.jcodings.Encoding.mbcCaseFold.

case fold flag

pp:IntHolder

Doc from org.jcodings.Encoding.mbcCaseFold.

an IntHolder that points at character head

lower:byte[]

Doc from org.jcodings.Encoding.mbcCaseFold.

a buffer where to extract case folded character Oniguruma equivalent: mbc_case_fold

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

Implements abstract org.jcodings.Encoding.mbcToCode.

Doc from org.jcodings.Encoding.mbcToCode.

Returns code point for a character Oniguruma equivalent: mbc_to_code

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

Overrides org.jcodings.AbstractEncoding.propertyNameToCType.

Doc from org.jcodings.AbstractEncoding.propertyNameToCType.

onigenc_minimum_property_name_to_ctype notably overridden by unicode encodings

Annotations
@Override
SJIS_ISMB_TRAILback to summary
private static boolean SJIS_ISMB_TRAIL(int code)