public class StringTable extends Object
String.intern() but in this
case, I need the index out not just to make these strings unique.| Modifier and Type | Field and Description |
|---|---|
protected int |
index |
protected LinkedHashMap<String,Integer> |
table |
| Constructor and Description |
|---|
StringTable() |
| Modifier and Type | Method and Description |
|---|---|
int |
add(String s) |
int |
getNumberOfStrings() |
String[] |
toArray()
Return an array, possibly of length zero, with all strings
sitting at their appropriate index within the array.
|
List<String> |
toList()
Return a List, possibly of length zero, with all strings
sitting at their appropriate index within the array.
|
String |
toString() |
protected LinkedHashMap<String,Integer> table
protected int index
public int add(String s)
public String[] toArray()
public List<String> toList()
public int getNumberOfStrings()
Copyright © 2016 ANTLR. All Rights Reserved.