Top Inners Fields Constructors Methods
org.jcodings.specific

public final Class GB18030Encoding

extends MultiByteEncoding
Class Inheritance
Imports
org.jcodings.IntHolder, .MultiByteEncoding, org.jcodings.ascii.AsciiTables

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final int
private static final String
private static final int[]
private static final int[][]
public static final GB18030Encoding
Inherited from org.jcodings.MultiByteEncoding:
AEncLenFTransTransZero

Constructor Summary

AccessConstructor and Description
protected

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.
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 boolean
isReverseMatchAllowed(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.isReverseMatchAllowed.

Returns true if it's safe to use reversal Boyer-Moore search fail fast algorithm Oniguruma equivalent: is_allowed_reverse_match
public int
leftAdjustCharHead(byte[]
byte stream
bytes
,
int
position
start
,
int
stop
s
,
int
end
end
)

Implements abstract org.jcodings.Encoding.leftAdjustCharHead.

Seeks the previous character head in a stream Oniguruma equivalent: left_adjust_char_head
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
private int
lengthForThreeUptoFour(byte[] bytes, int p, int end, int s)

private int
lengthForTwoUptoFour(byte[] bytes, int p, int end, int s)

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
Inherited from org.jcodings.MultiByteEncoding:
caseMapisInRangelengthlengthForTwoUptoFourmb2CodeToMbcmb2CodeToMbcLengthmb2IsCodeCTypemb4CodeToMbcmb4CodeToMbcLengthmb4IsCodeCTypembnMbcCaseFoldmbnMbcToCodemissingmissingsafeLengthForUptoFoursafeLengthForUptoThreesafeLengthForUptoTwostrCodeAtstrLength

Field Detail

C1back to summary
private static final int C1
C2back to summary
private static final int C2
C4back to summary
private static final int C4
CMback to summary
private static final int CM
GB18030back to summary
private static final String GB18030
GB18030_MAPback to summary
private static final int[] GB18030_MAP
GB18030Transback to summary
private static final int[][] GB18030Trans
INSTANCEback to summary
public static final GB18030Encoding INSTANCE

Constructor Detail

GB18030Encodingback to summary
protected GB18030Encoding()

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
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
isReverseMatchAllowedback to summary
public boolean isReverseMatchAllowed(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.isReverseMatchAllowed.

Doc from org.jcodings.Encoding.isReverseMatchAllowed.

Returns true if it's safe to use reversal Boyer-Moore search fail fast algorithm Oniguruma equivalent: is_allowed_reverse_match

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

Implements abstract org.jcodings.Encoding.leftAdjustCharHead.

Doc from org.jcodings.Encoding.leftAdjustCharHead.

Seeks the previous character head in a stream Oniguruma equivalent: left_adjust_char_head

Parameters
bytes:byte[]

byte stream

start:int

position

s:int

stop

end:int

end

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
lengthForThreeUptoFourback to summary
private int lengthForThreeUptoFour(byte[] bytes, int p, int end, int s)
lengthForTwoUptoFourback to summary
private int lengthForTwoUptoFour(byte[] bytes, int p, int end, int s)
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
org.jcodings.specific back to summary

private final Enum GB18030Encoding.State

extends Enum<GB18030Encoding.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State
public static final GB18030Encoding.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static GB18030Encoding.State
public static GB18030Encoding.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

Even_C4CMback to summary
public static final GB18030Encoding.State Even_C4CM
Even_CM_Even_C4CMback to summary
public static final GB18030Encoding.State Even_CM_Even_C4CM
Even_CM_Even_CMC4back to summary
public static final GB18030Encoding.State Even_CM_Even_CMC4
Even_CM_Odd_C4CMback to summary
public static final GB18030Encoding.State Even_CM_Odd_C4CM
Even_CM_Odd_CMC4back to summary
public static final GB18030Encoding.State Even_CM_Odd_CMC4
Even_CM_One_CXback to summary
public static final GB18030Encoding.State Even_CM_One_CX
Even_CMC4back to summary
public static final GB18030Encoding.State Even_CMC4
Odd_C4CMback to summary
public static final GB18030Encoding.State Odd_C4CM
Odd_CM_Even_C4CMback to summary
public static final GB18030Encoding.State Odd_CM_Even_C4CM
Odd_CM_Even_CMC4back to summary
public static final GB18030Encoding.State Odd_CM_Even_CMC4
Odd_CM_Odd_C4CMback to summary
public static final GB18030Encoding.State Odd_CM_Odd_C4CM
Odd_CM_Odd_CMC4back to summary
public static final GB18030Encoding.State Odd_CM_Odd_CMC4
Odd_CM_One_CXback to summary
public static final GB18030Encoding.State Odd_CM_One_CX
Odd_CMC4back to summary
public static final GB18030Encoding.State Odd_CMC4
One_C2back to summary
public static final GB18030Encoding.State One_C2
One_C4back to summary
public static final GB18030Encoding.State One_C4
One_C4_Even_CMC4back to summary
public static final GB18030Encoding.State One_C4_Even_CMC4
One_C4_Odd_CMC4back to summary
public static final GB18030Encoding.State One_C4_Odd_CMC4
One_CMback to summary
public static final GB18030Encoding.State One_CM
One_CM_Even_C4CMback to summary
public static final GB18030Encoding.State One_CM_Even_C4CM
One_CM_Odd_C4CMback to summary
public static final GB18030Encoding.State One_CM_Odd_C4CM
One_CMC4back to summary
public static final GB18030Encoding.State One_CMC4
STARTback to summary
public static final GB18030Encoding.State START

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static GB18030Encoding.State valueOf(String name)
valuesback to summary
public static GB18030Encoding.State[] values()