bridge
Class BridgeProblem

java.lang.Object
  extended by bridge.BridgeProblem

public class BridgeProblem
extends java.lang.Object

This class represents the Bridge Crossing problem. It provides an introductory message describing the problem, stores the problem's possible moves and current state, and tests for whether the problem has been successfully solved.


Constructor Summary
BridgeProblem()
          The bridge problem constructor should create the initial bridge state object and store it as the problem's current state.
 
Method Summary
 BridgeState getCurrentState()
          Getter (accessor) for this problem's current bridge state.
 java.lang.String getIntroduction()
          Getter (accessor) for this problem's introduction string.
 java.util.List<BridgeMove> getMoves()
          Getter (accessor) for this problem's list of valid bridge move objects.
 void setCurrentState(BridgeState currentState)
          Setter (mutator) for this problem's current bridge state.
 boolean success()
          Tests for whether the current state of this problem indicates that the problem has been successfully solved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BridgeProblem

public BridgeProblem()
The bridge problem constructor should create the initial bridge state object and store it as the problem's current state. It should also create the 10 valid bridge move objects and store them on an accessible list.

Method Detail

getIntroduction

public java.lang.String getIntroduction()
Getter (accessor) for this problem's introduction string.

Returns:
the introduction string

getMoves

public java.util.List<BridgeMove> getMoves()
Getter (accessor) for this problem's list of valid bridge move objects.

Returns:
the list of bridge moves

success

public boolean success()
Tests for whether the current state of this problem indicates that the problem has been successfully solved.

Returns:
true if the problem has been solved, false otherwise

getCurrentState

public BridgeState getCurrentState()
Getter (accessor) for this problem's current bridge state.

Returns:
the current state

setCurrentState

public void setCurrentState(BridgeState currentState)
Setter (mutator) for this problem's current bridge state.

Parameters:
currentState - the state to be made this problem's current state