com.eriksilkensen.sudoku
Enum BoardDifficulties

java.lang.Object
  extended by java.lang.Enum<BoardDifficulties>
      extended by com.eriksilkensen.sudoku.BoardDifficulties
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BoardDifficulties>

public enum BoardDifficulties
extends java.lang.Enum<BoardDifficulties>

BoardDifficulties encapsulates the different possible difficulty levels for any given Sudoku Board. It also provides methods for accessing the URL associated with each difficulty level, along with a String representation of each.

Since:
1.0
Version:
02/13/07
Author:
Erik Silkensen

Enum Constant Summary
Easy
           
Hard
           
Harder
           
Medium
           
SuperEasy
           
SuperHard
           
VeryEasy
           
VeryHard
           
 
Method Summary
 java.net.URL getURL()
          Each difficulty level has its own URL that can be used to access and download Boards from the Vegard Hanssen's menneske Sudoku archive.
 int size()
          Returns the size - or number of difficulty levels - of this enum
static BoardDifficulties valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static BoardDifficulties[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SuperEasy

public static final BoardDifficulties SuperEasy

VeryEasy

public static final BoardDifficulties VeryEasy

Easy

public static final BoardDifficulties Easy

Medium

public static final BoardDifficulties Medium

Hard

public static final BoardDifficulties Hard

Harder

public static final BoardDifficulties Harder

VeryHard

public static final BoardDifficulties VeryHard

SuperHard

public static final BoardDifficulties SuperHard
Method Detail

values

public static BoardDifficulties[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (BoardDifficulties c : BoardDifficulties.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static BoardDifficulties valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getURL

public java.net.URL getURL()
                    throws java.net.MalformedURLException
Each difficulty level has its own URL that can be used to access and download Boards from the Vegard Hanssen's menneske Sudoku archive. The caller should deal with the MalformedURLException that it throws

Throws:
java.net.MalformedURLException

size

public int size()
Returns the size - or number of difficulty levels - of this enum