private static class SVGFont.CharListHelper
extends java.lang.Object
int
instead of char
allows us to
handle surrogate characters as well.Modifier and Type | Field and Description |
---|---|
private int[] |
charList
keeps added characters, is kept sorted for efficient search.
|
private java.lang.StringBuffer |
freshChars
this keeps all added characters in order.
|
private int |
nUsed
the number of slots actually used.
|
Constructor and Description |
---|
CharListHelper() |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
add(int c)
test, if the character is contained in the charList.
|
(package private) static int |
binSearch(int[] list,
int nUsed,
int chr)
unfortunatly, Arrays.binarySearch() does not support search in a
part of the array (not in jdk1.3 and jdk1.4).
|
(package private) void |
clearNewChars()
reset the string of recently added characters - used after glyphs were created for them.
|
(package private) java.lang.String |
getNewChars()
get a string of all characters added since last call to clearNewChars().
|
private int nUsed
private int[] charList
private java.lang.StringBuffer freshChars
java.lang.String getNewChars()
void clearNewChars()
boolean add(int c)
c
- static int binSearch(int[] list, int nUsed, int chr)
list
- to search withinnUsed
- the last used index, can be < list.lengthchr
- the character to lookup