001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021
022package org.biojava.bio.symbol;
023
024import java.util.Set;
025
026/**
027 * A translation table that will handle the many-to-one mappings
028 * that you see, for example, with genetic codes.
029 * <p>
030 * It differs from a ReversibleTranslationTable in that the reverse
031 * translation returns a Set of Symbols in the source alphabet that
032 * translate to give that Symbol in the target Alphabet.
033 *
034 * @author David Huen
035 */
036public interface ManyToOneTranslationTable extends TranslationTable {
037  /**
038   * Translate a single symbol from target alphabet to the source alphabet.
039   *
040   * @param sym the Symbol to reverse-translate (member of target alphabet)
041   * @return a Set containing symbols that translate to the specified Symbol.
042   * @throws IllegalSymbolException if sym is not a member of the target
043   *         alphabet
044   */
045  public Set untranslate(Symbol sym) throws IllegalSymbolException;
046}