de.ls5.jlearn.shared
Class AlphabetImpl

java.lang.Object
  extended by de.ls5.jlearn.shared.AlphabetImpl
All Implemented Interfaces:
Alphabet, Serializable

public class AlphabetImpl
extends Object
implements Alphabet

Author:
merten
See Also:
Serialized Form

Constructor Summary
AlphabetImpl()
           
 
Method Summary
 Symbol addSymbol(Symbol symbol)
          Add Symbol to this alphabet.
 Symbol addSymbol(Symbol symbol, int index)
          Add Symbol to this alphabet at the specified index.
 boolean equals(Object obj)
           
 int getIndexForSymbol(Symbol symbol)
          Return index of the given Symbol in this alphabet.
 Symbol getSymbolByIndex(int index)
          Return Symbol with the given index in this alphabet.
 List<Symbol> getSymbolList()
          Return a list of all Symbol objects in this alphabet.
 int size()
          Return number of smybols in this alphabet.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlphabetImpl

public AlphabetImpl()
Method Detail

getIndexForSymbol

public int getIndexForSymbol(Symbol symbol)
Description copied from interface: Alphabet
Return index of the given Symbol in this alphabet.

Specified by:
getIndexForSymbol in interface Alphabet
Returns:
index of symbol if symbol is in alphabet, -1 otherwise.

getSymbolByIndex

public Symbol getSymbolByIndex(int index)
Description copied from interface: Alphabet
Return Symbol with the given index in this alphabet.

Specified by:
getSymbolByIndex in interface Alphabet
Returns:
symbol with given index if symbol is in alphabet, null otherwise.

addSymbol

public Symbol addSymbol(Symbol symbol)
Description copied from interface: Alphabet
Add Symbol to this alphabet.

Specified by:
addSymbol in interface Alphabet
Returns:
symbol added to the alphabet

addSymbol

public Symbol addSymbol(Symbol symbol,
                        int index)
Description copied from interface: Alphabet
Add Symbol to this alphabet at the specified index.

Specified by:
addSymbol in interface Alphabet
Returns:
symbol added to the alphabet

getSymbolList

public List<Symbol> getSymbolList()
Description copied from interface: Alphabet
Return a list of all Symbol objects in this alphabet.

Specified by:
getSymbolList in interface Alphabet
Returns:
list of symbols

size

public int size()
Description copied from interface: Alphabet
Return number of smybols in this alphabet.

Specified by:
size in interface Alphabet
Returns:
number of symbols in alphabet

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.