|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.expasy.jpl.commons.collection.symbol.AlphabetImpl<T>
T - the symbol type.public final class AlphabetImpl<T>
An alphabet is a finite set of symbols.
| Field Summary | |
|---|---|
protected Map<Character,TreeView<? extends Symbol<T>>> |
map
mapping letter -> symbol tree |
protected Symbol.SymbolType<T> |
type
the type of alphabet defined by its symbol type |
| Method Summary | ||
|---|---|---|
static
|
fromSymbols(Symbol.SymbolType<T> type,
TreeView<? extends Symbol<T>> tree)
Create an alphabet from the tree of symbols (mapping name -> symbol tree). |
|
Set<Character> |
getLetters()
|
|
String |
getRegEx()
|
|
Set<Symbol<T>> |
getSymbolLeaves()
|
|
int |
getSymbolNumber()
|
|
Symbol.SymbolType<T> |
getSymbolType()
|
|
boolean |
hasSymbol(char name)
|
|
boolean |
isTerminalSymbol(Symbol<T> symbol)
|
|
Symbol<T> |
lookupSymbol(char name)
|
|
TreeView<? extends Symbol<T>> |
lookupSymbolNode(char name)
|
|
static
|
newInstance(Symbol.SymbolType<T> type)
|
|
void |
registerAllSymbolNodes(TreeView<? extends Symbol<T>> symbolNode)
Add all nodes including the given tree root in the symbol table |
|
void |
registerSymbolNode(TreeView<? extends Symbol<T>> symbolNode)
Add the given node in the symbol table |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Map<Character,TreeView<? extends Symbol<T>>> map
protected Symbol.SymbolType<T> type
| Method Detail |
|---|
public static <T> AlphabetImpl<T> newInstance(Symbol.SymbolType<T> type)
public static <T> AlphabetImpl<T> fromSymbols(Symbol.SymbolType<T> type,
TreeView<? extends Symbol<T>> tree)
public final Symbol.SymbolType<T> getSymbolType()
public final Set<Symbol<T>> getSymbolLeaves()
public Set<Character> getLetters()
getLetters in interface AlphabetView<T>public String getRegEx()
getRegEx in interface AlphabetView<T>public final void registerSymbolNode(TreeView<? extends Symbol<T>> symbolNode)
Alphabet
registerSymbolNode in interface Alphabet<T>public final void registerAllSymbolNodes(TreeView<? extends Symbol<T>> symbolNode)
Alphabet
registerAllSymbolNodes in interface Alphabet<T>public final TreeView<? extends Symbol<T>> lookupSymbolNode(char name)
lookupSymbolNode in interface AlphabetView<T>Tpublic final Symbol<T> lookupSymbol(char name)
lookupSymbol in interface AlphabetView<T>Tpublic final int getSymbolNumber()
getSymbolNumber in interface AlphabetView<T>public boolean hasSymbol(char name)
hasSymbol in interface AlphabetView<T>public boolean isTerminalSymbol(Symbol<T> symbol)
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||