/* * NodeBehavior.java * * Developed for the "Rethinking CS101" project. See http://www.cs101.org, the * CS101 homepage or email las@olin.edu. * * Please do not redistribute without obtaining permission. */ package nodenet; import java.util.Vector; /** * NodeBehavior is the interface you must implement in your code. It * defines a single method, act.
*
* @author Todd C. Parnell, tparnell@ai.mit.edu
* @version $Id: NodeBehavior.java,v 1.3 2004/01/14 21:43:17 gus Exp $
*/
public interface NodeBehavior {
/**
* TransmitPacket is the method you will write for this lab. It
* has two arguments, one which is an InputChannelVector
,
* and the other an OutputChannelVector
,
* corresponding to the inputs and outputs available to you. Note
* that the channels obtained from these vectors (if any) exist, but are
* perhaps disabled, full, or empty. You will need to be aware of
* these conditions.
*
*
TransmitPacket is called repeatedly by a Node
* from within a while (true) {}
loop. You
* should deal with a single task on each iteration. Failure to
* return promptly will result in unpredictable behavior.
*
* @see nodenet.ChannelFullException
* @see nodenet.ChannelDisabledException
* @see nodenet.ChannelEmptyException
* @param inputChannels A vector that may contain input channels
* @param outputChannels A vector that may contain output channels
*/
public void transmitPacket( InputChannelVector inputChannels,
OutputChannelVector outputChannels );
}
/*
* $Log: NodeBehavior.java,v $
* Revision 1.3 2004/01/14 21:43:17 gus
* more javadoc, plus reformat
*
* Revision 1.2 2004/01/14 20:23:21 gus
* Javadoc and comment cleanup
*
* Revision 1.1 2002/06/13 17:33:21 gus
* Moved all java files into the nodenet directory (who let them out anyway?)
*
* Revision 1.1.1.1 2002/06/05 21:56:35 root
* CS101 comes to Olin finally.
*
* Revision 1.4 2000/05/09 06:03:54 mharder
* Changed packagename from nodeNet to nodenet.
*
* Revision 1.3 1999/08/04 09:08:53 jsmthng
* Added javadoc comments to InputChannelVector and OutputChannelVector;
* finished updating the rest of the nodeNet package to reflect new
* changes in name and code.
*
* Modified index.html to reflect the new nodeNet code, as well as to
* clarify some parts of the problem set.
*
* Revision 1.1 1999/07/30 01:09:22 jsmthng
* Renaming BinSort package to nodeNet; moving directories and files as
* necessary.
*
* Revision 1.4 1998/08/12 19:29:39 tparnell
* Another pass after comments from las & natashao. Added support to
* dynamically add NodeBehaviors. Add keyboard shortcuts to menus. Added
* workaround to jdk bug relating to lighweight components. Misc other
* bugfixes.
*
* Revision 1.3 1998/08/10 17:45:50 tparnell
* Revision to use JDK1.2 and Swing. Redesign of GUI. Removed old kludge
* for file I/O and replaced with object serialization. Channel no longer
* requires animacy. Removed unnessary dependencies between classes.
* Added ability to configure channel's latency and capacity. Added
* javadoc to all files. General code cleanup.
*
*/