001    /* sillyview : a free model-view-controller system for Java
002     * Copyright (C) 2004 T.J. Willis
003     * 
004     * This program is free software; you can redistribute it and/or
005     * modify it under the terms of the GNU General Public License
006     * as published by the Free Software Foundation; either version 2
007     * of the License, or (at your option) any later version.
008     *      
009     * This program is distributed in the hope that it will be useful,
010     * but WITHOUT ANY WARRANTY; without even the implied warranty of
011     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012     * GNU General Public License for more details.
013     *          
014     * You should have received a copy of the GNU General Public License
015     * along with this program; if not, write to the Free Software
016     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
017     *  
018     * $Header: /cvsroot/sillyview/sillyview/src/net/sourceforge/sillyview/WidgetModel.java,v 1.2 2004/05/15 01:58:51 tj_willis Exp $
019     */
020    package net.sourceforge.sillyview;
021    
022    /**
023     * A base interface for models.  Every model must be able to set a token,
024     * and get a token, as well as return its current state, it's unprocessed
025     * value, and a String representation of itself.
026     * 
027     *
028     * @author <a href="mailto:tj_willis@users.sourceforge.net">T.J. Willis</a>
029     * @version 1.0
030     */
031    public interface WidgetModel {
032        /**
033         * Describe constant <code>TRUE</code> here.
034         *
035         */
036        public static final String TRUE = WidgetView.TRUE;
037        /**
038         * Describe constant <code>FALSE</code> here.
039         *
040         */
041        public static final String FALSE = WidgetView.FALSE;
042    
043        /**
044         * Returns the current model, with tokens processed.
045         *
046         * @return an <code>Object</code> value
047         */
048        Object getCurrentModel ();
049    
050        /**
051         * Returns the current model, with tokens unprocessed.
052         *
053         * @return an <code>Object</code> value
054         */
055        Object getRawModel ();
056    
057    
058        /**
059         * Describe <code>setToken</code> method here.
060         *
061         * @param key an <code>Object</code> value
062         * @param value an <code>Object</code> value
063         */
064        void setToken (Object key, Object value);
065        /**
066         * Describe <code>getValue</code> method here.
067         *
068         * @param key an <code>Object</code> value
069         * @return an <code>Object</code> value
070         */
071        Object getValue (Object key);
072        /**
073         * Describe <code>toString</code> method here.
074         *
075         * @return a <code>String</code> value
076         */
077        String toString ();
078    
079    }