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.impl;
023
024import java.io.Serializable;
025
026import org.biojava.bio.Annotation;
027import org.biojava.bio.seq.FeatureRealizer;
028import org.biojava.bio.seq.Sequence;
029import org.biojava.bio.seq.SequenceFactory;
030import org.biojava.bio.symbol.SymbolList;
031
032/**
033 * A no-frills implementation of SequenceFactory that produces SimpleSequence
034 * objects.
035 *
036 * @author Matthew Pocock
037 * @author Thomas Down
038 */
039public class SimpleSequenceFactory implements SequenceFactory, Serializable {
040    private FeatureRealizer realizer = org.biojava.bio.seq.impl.FeatureImpl.DEFAULT;
041    
042    /**
043    *Returns the FeatureRealizer set by "setFeatureRealizer".
044    */
045    
046    public FeatureRealizer getFeatureRealizer() {
047        return realizer;
048    }
049
050    /**
051     * Set the FeatureRealizer used by new sequences created by this
052     * factory.
053     */
054
055    public void setFeatureRealizer(FeatureRealizer fr) {
056        realizer = fr;
057    }
058
059    public Sequence createSequence(SymbolList symList,
060                                   String uri, String name, Annotation annotation) {
061        return new org.biojava.bio.seq.impl.SimpleSequence(symList, uri, name, annotation, realizer);
062    }
063}