com.blackledge.david.game.crossword
Class PuzCrosswordSource

java.lang.Object
  extended by com.blackledge.david.game.crossword.PuzCrosswordSource
All Implemented Interfaces:
CrosswordSource

public class PuzCrosswordSource
extends Object
implements CrosswordSource

Interface to download the .puz format crosswords and build a CrosswordPuzzle object with that data.

Version:
$Revision: 1.4 $

Constructor Summary
PuzCrosswordSource()
           
 
Method Summary
 CrosswordPuzzle getGame()
          Return the game object.
protected  URL getGridURL()
           
 HashMap getParamMap()
          All the params of the quizland page
 String getPuzzleId()
          Returns a unique id (if available) representing the current puzzle.
 void load()
          Load the quizland crossword-of-the-day into the game object and validate it.
 void load(String puzzleId)
          Load the source into the game object and validate it.
static void main(String[] args)
          Simple main to show it work and spit it out to the command line.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PuzCrosswordSource

public PuzCrosswordSource()
Method Detail

main

public static void main(String[] args)
Simple main to show it work and spit it out to the command line.

Parameters:
args -

getGame

public CrosswordPuzzle getGame()
Return the game object. Called after CrosswordSource.load()

Specified by:
getGame in interface CrosswordSource
Returns:
the game object
See Also:
CrosswordSource.getGame()

getParamMap

public HashMap getParamMap()
All the params of the quizland page

Specified by:
getParamMap in interface CrosswordSource
Returns:
hashmap of name to value
See Also:
CrosswordSource.getParamMap()

toString

public String toString()
Overrides:
toString in class Object

load

public void load()
Load the quizland crossword-of-the-day into the game object and validate it.

Specified by:
load in interface CrosswordSource
See Also:
CrosswordSource.load()

getGridURL

protected URL getGridURL()
                  throws MalformedURLException,
                         IOException
Throws:
MalformedURLException
IOException

getPuzzleId

public String getPuzzleId()
Description copied from interface: CrosswordSource
Returns a unique id (if available) representing the current puzzle. If passed to CrosswordSource.load(String), this same puzzle will be loaded at that time.

Specified by:
getPuzzleId in interface CrosswordSource
Returns:
a String, or null if one is not available.

load

public void load(String puzzleId)
Description copied from interface: CrosswordSource
Load the source into the game object and validate it.

Specified by:
load in interface CrosswordSource
Parameters:
puzzleId - a string previuosly returned from CrosswordSource.getPuzzleId() for this source.