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.db;
023
024import java.util.Collections;
025import java.util.HashSet;
026import java.util.Set;
027
028/**
029 * <code>DummySequenceDBInstallation</code> is an implementation which
030 * returns the same <code>DummySequenceDB</code> instance regardless
031 * of the identifier used to retrieve a database.
032 *
033 * @author <a href="mailto:kdj@sanger.ac.uk">Keith James</a>
034 * @since 1.2
035 */
036public class DummySequenceDBInstallation implements SequenceDBInstallation
037{
038    SequenceDB dummyDB;
039    Set        sequenceDBs;
040
041    public DummySequenceDBInstallation()
042    {
043        sequenceDBs = new HashSet();
044        dummyDB     = new DummySequenceDB("dummy");
045        sequenceDBs.add(dummyDB);
046    }
047
048    public SequenceDBLite getSequenceDB(String identifier)
049    {
050        return dummyDB;
051    }
052
053    public Set getSequenceDBs()
054    {
055        return Collections.unmodifiableSet(sequenceDBs);
056    }
057
058    /**
059     * As this is a dummy implementation adding a sequenceDB doesn't do anything
060     */
061    public void addSequenceDB(SequenceDBLite sequenceDB, Set otherIdentifiers){}
062}