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.biojavax.bio.seq;
023import java.util.Set;
024
025import org.biojava.utils.ChangeVetoException;
026
027/**
028 * Holds feature relationships.
029 * @author Richard Holland
030 * @since 1.5
031 */
032public interface RichFeatureRelationshipHolder {
033    
034    /**
035     * Adds a relationship to this feature holder.
036     * @param relationship the relationship to add.
037     * @throws ChangeVetoException if the relationship is unacceptable.
038     */   
039    public void addFeatureRelationship(RichFeatureRelationship relationship) throws ChangeVetoException;
040    
041    /**
042     * Removes a relationship from this feature holder.
043     * @param relationship the relationship to remove.
044     * @throws ChangeVetoException if it cannot be removed.
045     */
046    public void removeFeatureRelationship(RichFeatureRelationship relationship) throws ChangeVetoException;
047
048    /**
049     * Returns the set of relationships held in this feature holder.
050     * @return a set of RichFeatureRelationship objects.
051     */
052    public Set<RichFeatureRelationship> getFeatureRelationshipSet();
053    
054    /**
055     * Clears the relations from this feature holder and replaces them with a new set.
056     * @param relationships the new set of features this holder should have. The set must 
057     * contain only RichFeatureRelationship objects.
058     * @throws ChangeVetoException if the new set could not be installed.
059     */
060    public void setFeatureRelationshipSet(Set<RichFeatureRelationship> relationships) throws ChangeVetoException;
061}