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

pack-priv Class CIDRange

extends Object
Class Inheritance

Range of continuous CIDs between two Unicode characters.

Field Summary

Modifier and TypeField and Description
private final int
private final int
private int
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
CIDRange(int
start value of COD range
from
,
int
end value of CID range
to
,
int
unicode start value
unicode
,
int
byte length of CID values
codeLength
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the given range was extended
extend
(int
start value of the new range
newFrom
,
int
end value of the new range
newTo
,
int
start CID value of the range
newCid
,
int
byte length of CIDs
length
)

Check if the given values represent a consecutive range of the given range.

public int

Returns:

the code length
getCodeLength
()

Returns the byte length of the codes of the CID range.

public int

Returns:

corresponding CID, or -1 if the character is out of range
map
(byte[]
Unicode character
bytes
)

Maps the given Unicode character to the corresponding CID in this range.

public int

Returns:

corresponding CID, or -1 if the character is out of range
map
(int
Unicode character
code
,
int
origin byte length of the code
length
)

Maps the given Unicode character to the corresponding CID in this range.

public int

Returns:

corresponding Unicode character, or -1 if the CID is out of range
unmap
(int
CID
code
)

Maps the given CID to the corresponding Unicode character in this range.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

codeLengthback to summary
private final int codeLength
fromback to summary
private final int from
toback to summary
private int to
unicodeback to summary
private final int unicode

Constructor Detail

CIDRangeback to summary
pack-priv CIDRange(int from, int to, int unicode, int codeLength)

Constructor.

Parameters
from:int

start value of COD range

to:int

end value of CID range

unicode:int

unicode start value

codeLength:int

byte length of CID values

Method Detail

extendback to summary
public boolean extend(int newFrom, int newTo, int newCid, int length)

Check if the given values represent a consecutive range of the given range. If so, extend the given range instead of creating a new one.

Parameters
newFrom:int

start value of the new range

newTo:int

end value of the new range

newCid:int

start CID value of the range

length:int

byte length of CIDs

Returns:boolean

true if the given range was extended

getCodeLengthback to summary
public int getCodeLength()

Returns the byte length of the codes of the CID range.

Returns:int

the code length

mapback to summary
public int map(byte[] bytes)

Maps the given Unicode character to the corresponding CID in this range.

Parameters
bytes:byte[]

Unicode character

Returns:int

corresponding CID, or -1 if the character is out of range

mapback to summary
public int map(int code, int length)

Maps the given Unicode character to the corresponding CID in this range.

Parameters
code:int

Unicode character

length:int

origin byte length of the code

Returns:int

corresponding CID, or -1 if the character is out of range

unmapback to summary
public int unmap(int code)

Maps the given CID to the corresponding Unicode character in this range.

Parameters
code:int

CID

Returns:int

corresponding Unicode character, or -1 if the CID is out of range