001 /* 002 * Resettable.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 * Created on January 12, 2004, 4:09 PM 008 * Please do not redistribute without obtaining permission. 009 */ 010 011 package nodenet; 012 013 /** 014 * An interface indicating that the state of the object can be reset to 015 * a standard initial state. This typically means getting rid of packets, 016 * setting packet counters to zero and similar re-initializations. 017 * 018 * @author Patrick G. Heck, gus.heck@olin.edu 019 */ 020 public interface Resettable { 021 022 /** 023 * Return all properties and other state to the initial state of the 024 * object so long as such changes do not alter the network structure. 025 * For example channels should drop all contained packets, but should 026 * not forget what nodes they are attached to. NodeBehaviors should 027 * implement this if they hold onto objects read from the channel 028 * after transmitPacket is called, otherwise resetting the network 029 * will leave some packets held in the nodes. 030 * 031 */ 032 public void reset(); 033 034 }