|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbridge.BridgeMove
public class BridgeMove
This class represents moves in the Bridge Crossing problem. A move object stores its move name and knows how to apply itself to a bridge state to create a new state representing the result of the move.
Constructor Summary | |
---|---|
BridgeMove(java.lang.String moveName)
Constructs a new bridge move object. |
Method Summary | |
---|---|
BridgeState |
doMove(BridgeState state)
Attempts to perform this move on a given bridge state. |
java.lang.String |
getMoveName()
Getter (accessor) for this move object's move name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BridgeMove(java.lang.String moveName)
moveName
- the name of this move.
It is an error if the name is not one of the following:
Method Detail |
---|
public java.lang.String getMoveName()
public BridgeState doMove(BridgeState state)
state
- the bridge state on which this move is to be performed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |