public class KeywordMap
extends java.lang.Object
Constructor and Description |
---|
KeywordMap(boolean ignoreCase)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.CharSequence keyword,
byte id)
Adds a key-value mapping.
|
byte |
lookup(javax.swing.text.Segment text,
int offset,
int length)
Looks up a key.
|
public KeywordMap(boolean ignoreCase)
ignoreCase
- if set, ignore match keys case-insensitivepublic byte lookup(javax.swing.text.Segment text, int offset, int length)
text
- the text segment to look upoffset
- the starting offset of the key within the text segmentlength
- the length of the keyToken.NULL
if no key
matchespublic void add(java.lang.CharSequence keyword, byte id)
keyword
- the key to addid
- the value to map to