Top Description Fields Constructors Methods
org.apache.fontbox.cmap

public Class CodespaceRange

extends Object
Class Inheritance

This represents a single entry in the codespace range.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private final int
private final int[]
private final int[]

Constructor Summary

AccessConstructor and Description
public
CodespaceRange(byte[]
start of the range
startBytes
,
byte[]
start of the range
endBytes
)

Creates a new instance of CodespaceRange.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the code length
getCodeLength
()

Returns the length of the codes of the codespace.

public boolean

Returns:

true if the given number of code bytes match this codespace range
isFullMatch
(byte[]
the code bytes to be matched
code
,
int
the code length to be used for matching
codeLen
)

Returns true if the given number of code bytes match this codespace range.

public boolean

Returns:

true if the given code bytes match this codespace range
matches
(byte[]
the code bytes to be matched
code
)

Returns true if the given code bytes match this codespace range.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

codeLengthback to summary
private final int codeLength
endback to summary
private final int[] end
startback to summary
private final int[] start

Constructor Detail

CodespaceRangeback to summary
public CodespaceRange(byte[] startBytes, byte[] endBytes)

Creates a new instance of CodespaceRange. The length of both arrays has to be the same.
For one byte ranges startBytes and endBytes define a linear range of values. Double byte values define a rectangular range not a linear range. Examples:
<00> <20> defines a linear range from 0x00 up to 0x20.
<8140> to <9FFC> defines a rectangular range. The high byte has to be within 0x81 and 0x9F and the low byte has to be within 0x40 and 0xFC

Parameters
startBytes:byte[]

start of the range

endBytes:byte[]

start of the range

Method Detail

getCodeLengthback to summary
public int getCodeLength()

Returns the length of the codes of the codespace.

Returns:int

the code length

isFullMatchback to summary
public boolean isFullMatch(byte[] code, int codeLen)

Returns true if the given number of code bytes match this codespace range.

Parameters
code:byte[]

the code bytes to be matched

codeLen:int

the code length to be used for matching

Returns:boolean

true if the given number of code bytes match this codespace range

matchesback to summary
public boolean matches(byte[] code)

Returns true if the given code bytes match this codespace range.

Parameters
code:byte[]

the code bytes to be matched

Returns:boolean

true if the given code bytes match this codespace range