lojix/search/src/main/com/thesett/aima/search/examples/eightpuzzle/EightPuzzleState.java
public EightPuzzleState getChildStateForOperator(Operator op)
    {
        // Create a copy of the existing board state
        EightPuzzleState newState;

        try
        {
            newState = (EightPuzzleState) clone();
        }
        catch (CloneNotSupportedException e)
        {
            throw new IllegalStateException("Puzzle state could not be cloned.", e);
        }

        // Update the new board state using the in-place operator application
        newState.updateWithOperator(op);

        return newState;
    }
public EightPuzzleState getChildStateForOperator(Operator op)
    {
        // Create a copy of the existing board state
        EightPuzzleState newState;

        try
        {
            newState = (EightPuzzleState) clone();
        }
        catch (CloneNotSupportedException e)
        {
            throw new IllegalStateException("Puzzle state could not be cloned.", e);
        }

        // Update the new board state using the in-place operator application
        newState.updateWithOperator(op);

        return newState;
    }
Applies a move to generate a new board position. This creates a new state object and updates its board position.
The board position in this object is not changed.

@param  op The move to apply to this board; "U" for up, "D" for down, "L" for left and "R" for right.

@return A new instance of EightPuzzleState with the operator applied to it.