| java.lang.Object org.gjt.sp.jedit.syntax.KeywordMap
KeywordMap | public class KeywordMap (Code) | | A KeywordMap is similar to a hashtable in that it maps keys
to values. However, the `keys' are Swing segments. This allows lookups of
text substrings without the overhead of creating a new string object.
author: Slava Pestov, Mike Dillon version: $Id: KeywordMap.java 5053 2004-05-29 01:55:26Z spestov $ |
Inner Class :class Keyword | |
Constructor Summary | |
public | KeywordMap(boolean ignoreCase) Creates a new KeywordMap . | public | KeywordMap(boolean ignoreCase, int mapLength) Creates a new KeywordMap . |
Method Summary | |
public void | add(String keyword, byte id) Adds a key-value mapping. | public void | add(char[] keyword, byte id) Adds a key-value mapping. | public void | add(KeywordMap map) Adds the content of another keyword map to this one. | public boolean | getIgnoreCase() Returns true if the keyword map is set to be case insensitive,
false otherwise. | public String[] | getKeywords() Returns an array containing all keywords in this keyword map. | public String | getNonAlphaNumericChars() Returns all non-alphanumeric characters that appear in the
keywords of this keyword map. | protected int | getSegmentMapKey(Segment s, int off, int len) | public byte | lookup(Segment text, int offset, int length) Looks up a key. | public void | setIgnoreCase(boolean ignoreCase) Sets if the keyword map should be case insensitive. |
KeywordMap | public KeywordMap(boolean ignoreCase)(Code) | | Creates a new KeywordMap .
Parameters: ignoreCase - True if keys are case insensitive |
KeywordMap | public KeywordMap(boolean ignoreCase, int mapLength)(Code) | | Creates a new KeywordMap .
Parameters: ignoreCase - True if the keys are case insensitive Parameters: mapLength - The number of `buckets' to create.A value of 52 will give good performance for most maps. |
add | public void add(String keyword, byte id)(Code) | | Adds a key-value mapping.
Parameters: keyword - The key Parameters: id - The value |
add | public void add(char[] keyword, byte id)(Code) | | Adds a key-value mapping.
Parameters: keyword - The key Parameters: id - The value since: jEdit 4.2pre3 |
add | public void add(KeywordMap map)(Code) | | Adds the content of another keyword map to this one.
since: jEdit 4.2pre3 |
getIgnoreCase | public boolean getIgnoreCase()(Code) | | Returns true if the keyword map is set to be case insensitive,
false otherwise.
|
getKeywords | public String[] getKeywords()(Code) | | Returns an array containing all keywords in this keyword map.
since: jEdit 4.0pre3 |
getNonAlphaNumericChars | public String getNonAlphaNumericChars()(Code) | | Returns all non-alphanumeric characters that appear in the
keywords of this keyword map.
since: jEdit 4.0pre3 |
getSegmentMapKey | protected int getSegmentMapKey(Segment s, int off, int len)(Code) | | |
lookup | public byte lookup(Segment text, int offset, int length)(Code) | | Looks up a key.
Parameters: text - The text segment Parameters: offset - The offset of the substring within the text segment Parameters: length - The length of the substring |
setIgnoreCase | public void setIgnoreCase(boolean ignoreCase)(Code) | | Sets if the keyword map should be case insensitive.
Parameters: ignoreCase - True if the keyword map should be caseinsensitive, false otherwise |
|
|