|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.chaperon.model.symbol.SymbolSet
public class SymbolSet
This class represents a set of symbols, which means that this set dosn't contains duplett of symbols.
Constructor Summary | |
---|---|
SymbolSet()
|
Method Summary | |
---|---|
boolean |
addSymbol(Symbol symbol)
|
boolean |
addSymbol(SymbolCollection collection)
|
void |
clear()
Removes all symbols from this set. |
java.lang.Object |
clone()
Create a clone of this set of symbols |
boolean |
contains(java.lang.String name)
If the list contains a symbol, given by the name of the symbol. |
boolean |
contains(Symbol symbol)
If the list contains a symbol |
boolean |
contains(SymbolCollection collection)
|
boolean |
equals(java.lang.Object o)
Compares to another set of symbols. |
SymbolSet |
getNonterminals()
Return all used nonterminal symbols in this set. |
Symbol |
getSymbol(int index)
Return a symbol giving by an index. |
Symbol |
getSymbol(java.lang.String name)
Returns a symbol from this set given by the name of the symbol. |
int |
getSymbolCount()
Returns the count of symbols in this set |
SymbolSet |
getTerminals()
Return all used terminal symbols in this set. |
int |
indexOf(java.lang.String name)
Return the index of a symbol, given by the name of the Symbol. |
int |
indexOf(Symbol symbol)
Return the index of a symbol. |
boolean |
isEmpty()
If this set is empty. |
void |
removeSymbol(int index)
Removes a symbol by an index from this set. |
void |
removeSymbol(Symbol symbol)
Removes a symbol from this set. |
void |
setSymbol(int index,
Symbol symbol)
Replace a symbol given by an index. |
java.lang.String |
toString()
Return a string representation of the set. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SymbolSet()
Method Detail |
---|
public boolean addSymbol(Symbol symbol)
addSymbol
in interface SymbolCollection
public boolean addSymbol(SymbolCollection collection)
addSymbol
in interface SymbolCollection
public void removeSymbol(int index)
removeSymbol
in interface SymbolCollection
index
- Index of the symbol.public void removeSymbol(Symbol symbol)
removeSymbol
in interface SymbolCollection
symbol
- Symbol, which should be removed.public void setSymbol(int index, Symbol symbol)
setSymbol
in interface SymbolCollection
index
- The index, at which the symbol be inserted.symbol
- Symbol.public Symbol getSymbol(int index)
getSymbol
in interface SymbolCollection
index
- Index of the symbol.
public Symbol getSymbol(java.lang.String name)
getSymbol
in interface SymbolCollection
name
- Name of the symbol.
public int getSymbolCount()
getSymbolCount
in interface SymbolCollection
public boolean isEmpty()
isEmpty
in interface SymbolCollection
public int indexOf(Symbol symbol)
indexOf
in interface SymbolCollection
symbol
- Symbol.
public int indexOf(java.lang.String name)
indexOf
in interface SymbolCollection
name
- Name of symbol.
public boolean contains(Symbol symbol)
contains
in interface SymbolCollection
symbol
- Symbol
public boolean contains(java.lang.String name)
contains
in interface SymbolCollection
name
- Name of the symbol.
public boolean contains(SymbolCollection collection)
public void clear()
clear
in interface SymbolCollection
public SymbolSet getTerminals()
public SymbolSet getNonterminals()
public boolean equals(java.lang.Object o)
equals
in interface SymbolCollection
equals
in class java.lang.Object
o
- Another object.
public java.lang.String toString()
toString
in interface SymbolCollection
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- If a exception occurs during the cloning.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |