001    /**
002     * planningtool - A Planning Tool with Critiquing Support.
003     * 
004     * Copyright (C) 2006 olale
005    
006     * This program is free software; you can redistribute it and/or
007     * modify it under the terms of the GNU General Public License
008     * as published by the Free Software Foundation; either version 2
009     * of the License, or (at your option) any later version.
010    
011     * This program is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015    
016     * You should have received a copy of the GNU General Public License
017     * along with this program; if not, write to the Free Software
018     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019    
020     * Contact information: 
021     * E-mail: olale@ida.liu.se
022     *         olale@lysator.liu.se
023     */
024    package se.liu.ida.critiquer.activities;
025    
026    import se.liu.ida.critiquer.activities.parameters.Parameter;
027    
028    /**
029     * 
030     * Classes implementing this interface are checked before changes to activities
031     * occur. If the methods in this interface return <code>true</code>, the
032     * changes take place. Otherwise not.
033     * 
034     * @author olale
035     * 
036     */
037    
038    public interface ActivityConsistencyCheck {
039            /**
040         * 
041         * Whenever a paramChanged event occurs, this method is called in all
042         * registered ActivityConsistencyCheck listeners that are available in an
043         * activity.
044         * 
045         * @param <T> -
046         *            The type of value the parameter represents
047         * @param a
048         * @param p
049         * @param newValue -
050         *            The suggested new value
051         * @return true - if the change is allowed, false if not
052         */
053            public <T> boolean paramValueCheck(Activity a, Parameter<T> p, T newValue);
054    
055            public boolean childOfCheck(Activity parentActivity, Activity Child);
056            public boolean orderingCheck(Activity beforeActivity,Activity AfterActivity);
057            
058    }