Top Fields Constructors Methods
org.jcodings.unicode

public abstract Class FixedWidthUnicodeEncoding

extends UnicodeEncoding
Class Inheritance
Known Direct Subclasses
org.jcodings.specific.UTF32BEEncoding, org.jcodings.specific.UTF32LEEncoding
Imports
org.jcodings.IntHolder, org.jcodings.util.Macros

Field Summary

Modifier and TypeField and Description
protected final int
Inherited from org.jcodings.unicode.UnicodeEncoding:
CASE_MAPPING_SLACKDOT_ABOVEDOTLESS_iI_WITH_DOT_ABOVEUNICODE_ISO_8859_1_CTypeTable

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public final int
codeToMbcLength(int code)

Implements abstract org.jcodings.Encoding.codeToMbcLength.

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

Implements abstract org.jcodings.Encoding.ctypeCodeRange.

onigenc_utf16_32_get_ctype_code_range
public final 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 final int
leftAdjustCharHead(byte[]
byte stream
bytes
,
int
position
p
,
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 final 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
)

Overrides org.jcodings.MultiByteEncoding.length.

Returns character length given character head returns 1 for singlebyte encodings or performs direct length table lookup for multibyte ones.
public int
length(byte[] bytes, int p, int e)

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 static int
log2(int n)

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

Overrides org.jcodings.MultiByteEncoding.strCodeAt.

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

Overrides org.jcodings.MultiByteEncoding.strLength.

Inherited from org.jcodings.unicode.UnicodeEncoding:
applyAllCaseFoldcaseFoldCodesByStringcaseMapctypeCodeRangegetCharsetNameisCodeCTypeisInCodeRangembcCaseFoldpropertyNameToCType

Field Detail

shiftback to summary
protected final int shift

Constructor Detail

FixedWidthUnicodeEncodingback to summary
protected FixedWidthUnicodeEncoding(String name, int width)

Method Detail

codeToMbcLengthback to summary
public final 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 final int[] ctypeCodeRange(int ctype, IntHolder sbOut)

Implements abstract org.jcodings.Encoding.ctypeCodeRange.

onigenc_utf16_32_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.

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 final int leftAdjustCharHead(byte[] bytes, int p, 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

p:int

position

s:int

stop

end:int

end

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

Overrides org.jcodings.MultiByteEncoding.length.

Doc from org.jcodings.Encoding.length.

Returns character length given character head returns 1 for singlebyte encodings or performs direct length table lookup for multibyte ones.

Parameters
c:byte

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 e)

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
log2back to summary
private static int log2(int n)
strCodeAtback to summary
public final int strCodeAt(byte[] bytes, int p, int end, int index)

Overrides org.jcodings.MultiByteEncoding.strCodeAt.

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

Overrides org.jcodings.MultiByteEncoding.strLength.

Annotations
@Override