Class KeywordMap
java.lang.Object
com.inductiveautomation.ignition.client.jedittextarea.KeywordMap
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.
 
 This class is used by CTokenMarker to map keywords to ids.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionKeywordMap(boolean ignoreCase) Creates a newKeywordMap.KeywordMap(boolean ignoreCase, int mapLength) Creates a newKeywordMap.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a key-value mapping.booleanReturns true if the keyword map is set to be case insensitive, false otherwise.protected intgetSegmentMapKey(Segment s, int off, int len) protected intbyteLooks up a key.voidsetIgnoreCase(boolean ignoreCase) Sets if the keyword map should be case insensitive.
- 
Field Details- 
mapLengthprotected int mapLength
 
- 
- 
Constructor Details- 
KeywordMappublic KeywordMap(boolean ignoreCase) Creates a newKeywordMap.- Parameters:
- ignoreCase- True if keys are case insensitive
 
- 
KeywordMappublic KeywordMap(boolean ignoreCase, int mapLength) Creates a newKeywordMap.- Parameters:
- ignoreCase- True if the keys are case insensitive
- mapLength- The number of `buckets' to create. A value of 52 will give good performance for most maps.
 
 
- 
- 
Method Details- 
lookupLooks up a key.- Parameters:
- text- The text segment
- offset- The offset of the substring within the text segment
- length- The length of the substring
 
- 
addAdds a key-value mapping.- Parameters:
- keyword- The key
- id- The value
 
- 
getIgnoreCasepublic boolean getIgnoreCase()Returns true if the keyword map is set to be case insensitive, false otherwise.
- 
setIgnoreCasepublic void setIgnoreCase(boolean ignoreCase) Sets if the keyword map should be case insensitive.- Parameters:
- ignoreCase- True if the keyword map should be case insensitive, false otherwise
 
- 
getStringMapKey
- 
getSegmentMapKey
 
-