|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsofya.mutator.StringTable
public final class StringTable
Table that maps strings to integer indices to provide string compaction, primarily for use in writing strings to files.
| Constructor Summary | |
|---|---|
StringTable()
Creates a new string table. |
|
| Method Summary | |
|---|---|
int |
addString(java.lang.String str)
Adds a string to this table. |
java.lang.String |
lookupIndex(int index)
Gets the string associated with a given index in this table, if the index exists in the table. |
int |
lookupString(java.lang.String str)
Gets the index of a string, if it has been added to this table. |
int |
size()
Gets the number of strings indexed by this table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringTable()
| Method Detail |
|---|
public int addString(java.lang.String str)
str - String to be added to this table.
public int lookupString(java.lang.String str)
throws java.util.NoSuchElementException
str - String for which to retrieve the assigned index from
this table.
java.util.NoSuchElementException - If the specified string has not been
added to this table.
public java.lang.String lookupIndex(int index)
throws java.util.NoSuchElementException
index - Index for which to find the associated string.
java.util.NoSuchElementException - If the specified index does not have
a mapping in this table.public int size()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||