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.seq;
023
024import org.biojava.bio.BioException;
025
026/**
027 * Interface for translators which map from Feature.Template
028 * instances to real Feature objects. <strong>NOTE</strong>
029 * this interface is intended for use primarily by Sequence
030 * implementors.  Normal users can generally ignore it.
031 *
032 * <p>
033 * There is no requirement that Sequence implementations
034 * use FeatureRealizers to construct their features, but common
035 * implementations such as SimpleSequence and ViewSequence do.
036 * </p>
037 *
038 * @author Thomas Down
039 */
040
041public interface FeatureRealizer {
042    /**
043     * Install a feature on the specified sequence.
044     *
045     * @param seq The sequence to which the feature will be added.
046     * @param template A description of the desired feature.
047     * @param parent The FeatureHolder which is to be the Feature's
048     *               immediate parent.
049     * @return A newly constructed feature, to be added to the sequence.
050     * @throws BioException If the feature could not be constructed.
051     */
052
053    public Feature realizeFeature(Sequence seq,
054                                  FeatureHolder parent,
055                                  Feature.Template template)
056            throws BioException;
057}
058
059