Class RouletteWheel

java.lang.Object
  extended by RouletteWheel

public class RouletteWheel
extends java.lang.Object

Class that models an American-style roulette wheel (with numbers 1-36, 0, and 00).

Version:
9/15/15
Author:
Dave Reed

Constructor Summary
RouletteWheel()
          Constructor for objects of class RouletteWheel
 
Method Summary
 java.lang.String getColor(java.lang.String slotValue)
          Determines the color for a particular number on the wheel.
 int getNumberOfSpins()
          Reports the number of times the wheel has been spun.
 java.lang.String getParity(java.lang.String slotValue)
          Determines the parity for a particular number on the wheel.
 java.lang.String spin()
          Simulates a single spin of the roulette wheel.
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouletteWheel

public RouletteWheel()
Constructor for objects of class RouletteWheel

Method Detail

getColor

public java.lang.String getColor(java.lang.String slotValue)
Determines the color for a particular number on the wheel.

Parameters:
slotValue - the slot value on the wheel (e.g., "12" or "00")
Returns:
that slot value's color (either "red", "black", or "green")

getNumberOfSpins

public int getNumberOfSpins()
Reports the number of times the wheel has been spun.

Returns:
the number of spins so far

getParity

public java.lang.String getParity(java.lang.String slotValue)
Determines the parity for a particular number on the wheel.

Parameters:
slotValue - the slot value on the wheel (e.g., "12" or "00")
Returns:
that slot value's parity (either "odd", "even", or "zero")

spin

public java.lang.String spin()
Simulates a single spin of the roulette wheel.

Returns:
the slot value obtained by the spin (e.g., "12" or "00")