org.biojava3.core.sequence.template
Class AbstractCompoundTranslator<F extends Compound,T extends Compound>

java.lang.Object
  extended by org.biojava3.core.sequence.template.AbstractCompoundTranslator<F,T>
All Implemented Interfaces:
CompoundTranslator<F,T>
Direct Known Subclasses:
DNAToRNATranslator, RNAToAminoAcidTranslator

public abstract class AbstractCompoundTranslator<F extends Compound,T extends Compound>
extends Object
implements CompoundTranslator<F,T>


Constructor Summary
AbstractCompoundTranslator(SequenceCreatorInterface<T> creator, CompoundSet<F> fromCompoundSet, CompoundSet<T> toCompoundSet)
           
 
Method Summary
protected  void addCompounds(F source, T... targets)
           
protected  void addCompoundsToList(List<T> compounds, List<List<T>> workingList)
           
protected  void addCompoundToLists(List<List<T>> list, T compound)
           
protected  void addStrings(String source, String... targets)
           
 Sequence<T> createSequence(Sequence<F> originalSequence)
           
 List<Sequence<T>> createSequences(Sequence<F> originalSequence)
           
 SequenceCreatorInterface<T> getCreator()
           
 CompoundSet<F> getFromCompoundSet()
           
 CompoundSet<T> getToCompoundSet()
           
protected abstract  void postProcessCompoundLists(List<List<T>> compoundLists)
           
 T translate(F fromCompound)
           
 List<T> translateMany(F fromCompound)
           
protected  List<Sequence<T>> workingListToSequences(List<List<T>> workingList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCompoundTranslator

public AbstractCompoundTranslator(SequenceCreatorInterface<T> creator,
                                  CompoundSet<F> fromCompoundSet,
                                  CompoundSet<T> toCompoundSet)
Method Detail

getCreator

public SequenceCreatorInterface<T> getCreator()

getFromCompoundSet

public CompoundSet<F> getFromCompoundSet()

getToCompoundSet

public CompoundSet<T> getToCompoundSet()

addStrings

protected void addStrings(String source,
                          String... targets)

addCompounds

protected void addCompounds(F source,
                            T... targets)

translateMany

public List<T> translateMany(F fromCompound)
Specified by:
translateMany in interface CompoundTranslator<F extends Compound,T extends Compound>

translate

public T translate(F fromCompound)
Specified by:
translate in interface CompoundTranslator<F extends Compound,T extends Compound>

createSequences

public List<Sequence<T>> createSequences(Sequence<F> originalSequence)
Specified by:
createSequences in interface CompoundTranslator<F extends Compound,T extends Compound>

postProcessCompoundLists

protected abstract void postProcessCompoundLists(List<List<T>> compoundLists)

addCompoundsToList

protected void addCompoundsToList(List<T> compounds,
                                  List<List<T>> workingList)

workingListToSequences

protected List<Sequence<T>> workingListToSequences(List<List<T>> workingList)

addCompoundToLists

protected void addCompoundToLists(List<List<T>> list,
                                  T compound)

createSequence

public Sequence<T> createSequence(Sequence<F> originalSequence)
Specified by:
createSequence in interface CompoundTranslator<F extends Compound,T extends Compound>