Class PegSolitaireNode

java.lang.Object
  |
  +--SearchNode
        |
        +--PegSolitaireNode
All Implemented Interfaces:
java.lang.Cloneable

public class PegSolitaireNode
extends SearchNode

PegSolitaireNode.java - Traditional 5-on-a-side Triangle Peg Solitaire; Goal: to leave one peg after removal of all others via linear jumps. Created: Fri Feb 2 10:10:13 2001


Fields inherited from class SearchNode
depth, parent
 
Constructor Summary
PegSolitaireNode()
          Creates a PegSolitaireNode instance and sets it to an initial search state.
 
Method Summary
 java.lang.Object clone()
          clone - return a copy of this node.
 boolean equals(java.lang.Object o)
          The equals method is especially useful for repeated state detection.
 java.util.Vector expand()
          expand - return a (possibly empty) Vector of this node's children
 boolean isGoal()
          isGoal - test whether or not the current node is a goal node.
 java.lang.String toString()
          toString - especially useful for debugging, tracing search execution, reporting results, etc.
 
Methods inherited from class SearchNode
childClone, printSearchPath
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PegSolitaireNode

public PegSolitaireNode()
Creates a PegSolitaireNode instance and sets it to an initial search state.
Method Detail

isGoal

public boolean isGoal()
isGoal - test whether or not the current node is a goal node.
Overrides:
isGoal in class SearchNode
Returns:
a boolean value

expand

public java.util.Vector expand()
expand - return a (possibly empty) Vector of this node's children
Overrides:
expand in class SearchNode
Returns:
a Vector of SearchNodes

clone

public java.lang.Object clone()
clone - return a copy of this node.
Overrides:
clone in class SearchNode
Returns:
an Object value

equals

public boolean equals(java.lang.Object o)
The equals method is especially useful for repeated state detection.
Overrides:
equals in class SearchNode
Parameters:
o - an Object value - object to test for equality with this
Returns:
a boolean value - whether or not two objects are equal

toString

public java.lang.String toString()
toString - especially useful for debugging, tracing search execution, reporting results, etc.
Overrides:
toString in class java.lang.Object
Returns:
a String value