Package crosby.binary
Class StringTable
- java.lang.Object
-
- crosby.binary.StringTable
-
public class StringTable extends Object
Class for mapping a set of strings to integers, giving frequently occurring strings small integers.
-
-
Constructor Summary
Constructors Constructor Description StringTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidfinish()intgetIndex(String s)After the stringtable has been built, return the offset of a string in it.voidincr(String s)Increments the count of the given stringOsmformat.StringTable.Builderserialize()
-
-
-
Method Detail
-
incr
public void incr(String s)
Increments the count of the given string- Parameters:
s- the string
-
getIndex
public int getIndex(String s)
After the stringtable has been built, return the offset of a string in it. Note, value '0' is reserved for use as a delimiter and will not be returned.- Parameters:
s- the string to lookup- Returns:
- the offset of the string
-
finish
public void finish()
-
clear
public void clear()
-
serialize
public Osmformat.StringTable.Builder serialize()
-
-