Package org.apache.uima.cas.impl
Class StringSet
- java.lang.Object
-
- org.apache.uima.cas.impl.StringSet
-
final class StringSet extends java.lang.Object
Like string heap, but keeps strings in a hashmap (for quick testing) and an array list. This is used to emulate how v2 keeps strings, to support backwards compatibility for low-level access
-
-
Field Summary
Fields Modifier and Type Field Description private int
lastStringCode
private java.util.HashMap<java.lang.String,java.lang.Integer>
string2int
private java.util.ArrayList<java.lang.String>
strings
-
Constructor Summary
Constructors Constructor Description StringSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
getCodeForString(java.lang.String s)
get the code for a string, adding it to the string table if not already there.(package private) int
getSize()
(package private) java.lang.String
getStringForCode(int stringCode)
(package private) void
reset()
-
-
-
Method Detail
-
reset
void reset()
-
getStringForCode
java.lang.String getStringForCode(int stringCode)
-
getCodeForString
int getCodeForString(java.lang.String s)
get the code for a string, adding it to the string table if not already there.- Parameters:
s
- The string.- Returns:
- The code corresponding to the string, which can be used in the getStringForCode call above
-
getSize
int getSize()
-
-