001    /*
002     * Counter.java
003     *
004     * Developed for the "Rethinking CS101" project. See http://www.cs101.org, the
005     * CS101 homepage or email las@olin.edu.
006     *
007     * Please do not redistribute without obtaining permission.
008     */
009    
010    package nodenet;
011    
012    /**
013     * An interface for NodeBehaviors that keep track of the number of
014     * objects they have seen.  By implementing this interface,
015     * <code>SimulationPanel</code> will display the value returned by
016     * <code>getCount()</code> whenever the node is displayed. This class
017     * replaces CountingNodeBehavior<p>
018     *
019     * @author Patrick G. Heck gus.heck@olin.edu
020     * @version $Id: Counter.java,v 1.3 2004/01/14 21:43:17 gus Exp $
021     */
022    public interface Counter {
023        
024        /**
025         * Returns the number of packets generated, moved or recieved as
026         * appropriate.
027         *
028         * @return The number of packets counted sofar.
029         */
030        public int getCount();
031        
032        /**
033         * Resets the count.
034         */
035        public void resetCount();
036    }
037    
038    /*
039     * $Log: Counter.java,v $
040     * Revision 1.3  2004/01/14 21:43:17  gus
041     * more javadoc, plus reformat
042     *
043     * Revision 1.2  2004/01/14 20:23:21  gus
044     * Javadoc and comment cleanup
045     *
046     * Revision 1.1  2004/01/13 19:35:27  gus
047     * Simulation Panel, channel and node are all Resettable now.
048     * CountingNodeBehavior refactored into Counter
049     *
050     */
051    
052    
053    
054