org.dolben.MarkN
Class Configuration

java.lang.Object
  extended by org.dolben.MarkN.Configuration

public class Configuration
extends java.lang.Object

This is the configuration for the N Digit Number Game: the number (N) of places in a target or guess, and the number of digits that are used (e.g., 10, ('0'-'9')). Note that the terminology is conflicting, as "N Digit" in the name of the game, denotes the number of places in a Number.


Constructor Summary
Configuration()
           
 
Method Summary
static int getDigits()
          gets the number of digits
static int getPlaces()
          gets the number of places
static void setDigits(java.lang.String s)
          sets the number of digits
static void setPlaces(java.lang.String s)
          sets the number of places
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()
Method Detail

setDigits

public static void setDigits(java.lang.String s)
                      throws java.lang.Exception
sets the number of digits

Parameters:
s - the number of digits as represented by a string
Throws:
java.lang.Exception - when s cannot be parsed as an integer, or the number doesn't result in a valid configuration, or the configuration has already been used

setPlaces

public static void setPlaces(java.lang.String s)
                      throws java.lang.Exception
sets the number of places

Parameters:
s - the number of places, N, as represented by a string
Throws:
java.lang.Exception - when s cannot be parsed as an integer, or the number doesn't result in a valid configuration, or the configuration has already been used

getDigits

public static int getDigits()
gets the number of digits

Returns:
the number of digits

getPlaces

public static int getPlaces()
gets the number of places

Returns:
the number of places