jtge.sample.toss
Class Coin

java.lang.Object
  extended byjtge.sample.toss.Coin

public class Coin
extends java.lang.Object

This class implements the toss-game strategy component.

It encapsulates a random number generator in order to simulate the physical coin toss.

Version:
$Revision: 1.4 $ $Date: 2005/09/14 18:36:52 $
Author:
Mathieu Champlon

Constructor Summary
Coin()
          Create a new coin.
 
Method Summary
 boolean toss()
          Toss a coin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Coin

public Coin()
Create a new coin.

Method Detail

toss

public final boolean toss()
Toss a coin.

Returns:
whether the result is a sucess or not


Copyright © 2003-2005 . All Rights Reserved.