Class PegSolitaireNode

java.lang.Object
  extended by SearchNode
      extended by 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.


Field Summary
 
Fields inherited from class SearchNode
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 deep copy of this node.
 boolean equals(java.lang.Object o)
          The equals method is especially useful for repeated state detection.
 java.util.ArrayList<SearchNode> expand()
          expand - return a (possibly empty) ArrayList 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
 
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.

Specified by:
isGoal in class SearchNode
Returns:
a boolean value

expand

public java.util.ArrayList<SearchNode> expand()
expand - return a (possibly empty) ArrayList of this node's children

Specified by:
expand in class SearchNode
Returns:
an ArrayList of SearchNodes

clone

public java.lang.Object clone()
clone - return a deep 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 java.lang.Object
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