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.program.homologene;
023
024import org.biojava.utils.ChangeType;
025import org.biojava.utils.ChangeVetoException;
026
027/**
028 * Interface for classes that store and manipulate
029 * orthologues.
030 * <p>
031 * You cannot create Orthologues here, just
032 * work with them.
033 *
034 * @author David Huen
035 * * @author Matthew Pocock
036 */
037public interface OrthologueSet
038{
039
040    public static final ChangeType MODIFY = 
041        new ChangeType("OrthologueSet modified",
042            "org.biojava.bio.program.homologene.OrthologueSet",
043            "MODIFY");
044
045    /**
046     * An iterator for the contents of
047     * an OrthologueSet.
048     */
049    public interface Iterator
050    {
051        public boolean hasNext();
052        public Orthologue nextOrthologue();
053    }
054
055    /*
056     * Retrieve an orthologue from the set.
057     */
058    public Orthologue getOrthologue(String homologeneID);
059
060    /**
061     * Add an orthologue to the set.
062     */
063    public void addOrthologue(Orthologue ortho) throws ChangeVetoException;
064
065    /**
066     * Remove an orthologue from the set.
067     */
068    public void removeOrthologue(Orthologue ortho) throws ChangeVetoException;
069
070    /**
071     * Return an iterator to the contents of the set.
072     */
073    public Iterator iterator();
074
075    /**
076     * Filter the contents of a set.
077     */
078    public OrthologueSet filter(OrthologueFilter filter);
079}