/* * Simplest demo network simulation. * class Node.java * R P Futrelle, 7/18/2001 */ /** * A node might be a workstation or PC on the net. * It is attached to the link and sends and receives * messages */ public class Node { Link link; int nodeID; public static void main(String[] args){ } // main() public Node(int nodeID, Link ln) { link = ln; this.nodeID = nodeID; }// Node() public void send() { if(Math.random() < 0.1) link.insert("Is there life on this net?"); } // send() public Object receive() { return link.retrieve(); } // receive }// class Node