framework
Class Problem

java.lang.Object
  extended by framework.Problem
Direct Known Subclasses:
BridgeProblem, WaterJugProblem

public abstract class Problem
extends java.lang.Object

This abstract class represents a problem in a problem solving domain. Note that this class does not provide a constructor. It provides getters and setters for the current state of the problem, the list of moves for the problem, and the problem's introduction string. Extending classes need not have instance fields for these attributes, as they are inherited from this class. Extending classes must set these values in their constructors using the setters (mutators) provided in this class. Extending classes must also override the abstract success method.


Constructor Summary
Problem()
           
 
Method Summary
 State getCurrentState()
          Gets the current state of the problem.
 java.lang.String getIntroduction()
          Gets an explanatory introduction string for the problem.
 java.util.List<Move> getMoves()
          Gets the list of moves for this problem.
 void setCurrentState(State currentState)
          Sets the current state of the problem.
 void setIntroduction(java.lang.String introduction)
          Sets the introduction string for this problem.
 void setMoves(java.util.List<Move> moves)
          Sets the list of moves for this problem.
abstract  boolean success()
          Determines whether the current state of this problem is a success.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Problem

public Problem()
Method Detail

success

public abstract boolean success()
Determines whether the current state of this problem is a success. Extending classes need to override this method.

Returns:
whether the current state is a success

getCurrentState

public State getCurrentState()
Gets the current state of the problem.

Returns:
the current state

setCurrentState

public void setCurrentState(State currentState)
Sets the current state of the problem.

Parameters:
currentState - the current state

getIntroduction

public java.lang.String getIntroduction()
Gets an explanatory introduction string for the problem.

Returns:
the introduction string

setIntroduction

public void setIntroduction(java.lang.String introduction)
Sets the introduction string for this problem.

Parameters:
introduction - the introduction string

getMoves

public java.util.List<Move> getMoves()
Gets the list of moves for this problem.

Returns:
the list of moves

setMoves

public void setMoves(java.util.List<Move> moves)
Sets the list of moves for this problem.

Parameters:
moves - the list of moves