smithers.logicpuzzles
Interface Puzzle

All Known Implementing Classes:
Hanjie, Mosaic, Slitherlink

public interface Puzzle

Interface representing a logic puzzle.


Method Summary
 boolean isMutable()
          Checks whether this puzzle can be modified.
 Puzzle makeImmutableCopy()
          Creates a copy of this puzzle which cannot be modified further.
 java.lang.String toString()
          Generates a String representing the puzzle.
 

Method Detail

isMutable

boolean isMutable()
Checks whether this puzzle can be modified.

Returns:
true iff this puzzle is mutable

makeImmutableCopy

Puzzle makeImmutableCopy()
Creates a copy of this puzzle which cannot be modified further. If a mutable instance of Puzzle is used to construct a State or Solver, the constructer should call this method to get an immutable copy. Copies created by this method should return false to isMutable() and throw ImmutablePuzzleException when a method attempts to modify them.

Returns:
a copy of this puzzle which cannot be modified. This copy should be an instance of the same class as the object which created it.

toString

java.lang.String toString()
Generates a String representing the puzzle. The string returned by this method may or may not be human-readable.

Overrides:
toString in class java.lang.Object
Returns:
a String representing the puzzle