|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdasher.CAlphabetMap
public class CAlphabetMap
Simple map from the textual representation of alphabet symbols to their symbol numbers. This used to be a lot more complicated but now essentially just wraps a Java HashMap and could easily be removed and replaced by a HashMap member of Alphabet.
| Field Summary | |
|---|---|
protected java.util.HashMap<java.lang.String,SSymbol> |
hashTable
The map itself, from Strings to SSymbols (a small class giving its integer index and a boolean value which determines whether it constitutes a prefix symbol. |
private int |
Undefined
Constant used to represent any string which does not correspond to a valid symbol. |
| Constructor Summary | |
|---|---|
CAlphabetMap()
Default constructor; creates the hash table with a size of 255. |
|
CAlphabetMap(int InitialTableSize)
Creates the Hash Table with a given initial size. |
|
| Method Summary | |
|---|---|
void |
Add(java.lang.String Key,
int Value)
Adds a new key/value pair to the table. |
SSymbol |
Get(java.lang.String Key)
Retrieves a symbol index given the string representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.HashMap<java.lang.String,SSymbol> hashTable
SSymbolprivate final int Undefined
| Constructor Detail |
|---|
public CAlphabetMap(int InitialTableSize)
InitialTableSize - Initial sizepublic CAlphabetMap()
| Method Detail |
|---|
public void Add(java.lang.String Key,
int Value)
Key - String representation of a symbolValue - Integer index of same symbolpublic SSymbol Get(java.lang.String Key)
Key - String to look up
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||