org.expasy.jpl.commons.collection.symbol
Class AbstractDataSymbolRegister<T>
java.lang.Object
org.expasy.jpl.commons.collection.symbol.AbstractDataSymbolRegister<T>
- Type Parameters:
T -
- All Implemented Interfaces:
- Serializable, AlphabetView<T>, DataSymbolRegister<T>
public abstract class AbstractDataSymbolRegister<T>
- extends Object
- implements DataSymbolRegister<T>
Generic data symbol manager to include in jpl.
- Version:
- 1.0
- Author:
- nikitin
- See Also:
- Serialized Form
sym2data
protected Map<Symbol<T>,T> sym2data
AbstractDataSymbolRegister
protected AbstractDataSymbolRegister(Symbol.SymbolType<T> type)
lookupData
public T lookupData(Symbol<T> symbol)
- Specified by:
lookupData in interface DataSymbolRegister<T>
- Returns:
- the T-data mapped by the terminal symbol
hasSymbol
public boolean hasSymbol(char symbol)
- Specified by:
hasSymbol in interface AlphabetView<T>
- Returns:
- true if symbol exists
getSymbolNumber
public int getSymbolNumber()
- Specified by:
getSymbolNumber in interface AlphabetView<T>
- Returns:
- the number of symbols
lookupSymbol
public Symbol<T> lookupSymbol(char name)
- Specified by:
lookupSymbol in interface AlphabetView<T>
- Returns:
- a symbol of type
T
lookupSymbolNode
public TreeView<? extends Symbol<T>> lookupSymbolNode(char name)
- Specified by:
lookupSymbolNode in interface AlphabetView<T>
- Returns:
- a tree node over symbol of type
T
getLetters
public Set<Character> getLetters()
- Specified by:
getLetters in interface AlphabetView<T>
- Returns:
- the set of letters.
getRegEx
public String getRegEx()
- Specified by:
getRegEx in interface AlphabetView<T>
- Returns:
- the pattern that match this alphabet
toString
public String toString()
- Overrides:
toString in class Object
lookupData
public abstract T lookupData(char name)
- Specified by:
lookupData in interface DataSymbolRegister<T>
- Returns:
- the T-data mapped by the terminal named symbol
link
public abstract void link(Symbol<T> symbol,
T data)
- Description copied from interface:
DataSymbolRegister
- link a symbol to its data
- Specified by:
link in interface DataSymbolRegister<T>
createDataMap
public abstract Map<Character,T> createDataMap()
- Specified by:
createDataMap in interface DataSymbolRegister<T>
- Returns:
- a map data char -> T-data object
Copyright (c) 2012 Swiss Institute of Bioinformatics. All rights reserved.