Class EDU.gac.max.flip.NetFlip
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.gac.max.flip.NetFlip

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----EDU.gac.max.flip.Flip
                                           |
                                           +----EDU.gac.max.flip.NetFlip

public class NetFlip
extends Flip
This class is the main class for an application program called NetFlip that is an multi-user networked variant of the Flip program (a single-user puzzle program implemented by the Flip class). The idea is that all the users anywhere on the network are working together on a common puzzle -- they all see the same board, and each can manipulate it. This presumes that a FlipServer is running somewhere on the network to tie the various NetFlips together. The hostname of the machine running the FlipServer must be provided as a command-line argument to this program.

Warning: this NetFlip class may be missing some "synchronized" keywords on some methods -- either it or NetInterface is. This is intentional as part of a lab assignment on race conditions and monitors for the MC78 course. The students are supposed to find the race conditions and predict the buggy behavior that can result, then verify by inserting appropriate sleeps, then fix the problem by adding the needed synchronized keywords. So, either this class or the other class in this source file (NetInterface) is known to be buggy.

Written 17 Aug 1996 by Max Hailperin <max@gac.edu>

See Also:
FlipServer, NetInterface

Constructor Index

 o NetFlip(String)

Method Index

 o flip(int)
 o localFlip(int)
The localFlip method causes the user interface to flip the state/color of a particular key without any network communication.
 o main(String[])

Constructors

 o NetFlip
  public NetFlip(String server)

Methods

 o flip
  protected void flip(int key)
Overrides:
flip in class Flip
 o localFlip
  protected void localFlip(int key)
The localFlip method causes the user interface to flip the state/color of a particular key without any network communication.
 o main
  public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index