|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectklaus.chess.party.PartyNode
public class PartyNode
Represents a node in a Party tree
Field Summary | |
---|---|
private String |
comment
A comment |
private int |
id
A unique, auto-generated ID |
static int |
LAST_ID
|
private Move |
lastMove
|
private Vector<PartyNode> |
nextMoves
A vector containing all possible next moves ( that is, all variants including the pv) |
private int |
pv
The PV's (=principal variation's) index in nextMoves |
Constructor Summary | |
---|---|
PartyNode()
Create a new PartyNode for a new game (= root node) |
|
PartyNode(Move lastMove)
Create a new Party node within a game (= normal node) |
Method Summary | |
---|---|
void |
addPV(PartyNode next)
Adds a new variant and makes it PV |
void |
addVariant(PartyNode next)
Add a new variant |
String |
getComment()
Get the comment after this move. |
int |
getId()
|
Move |
getMove()
|
PartyNode |
getPV()
|
boolean |
hasPV()
|
void |
setComment(String comment)
Set the comment after the move |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int LAST_ID
private int id
private Move lastMove
private Vector<PartyNode> nextMoves
private int pv
private String comment
Constructor Detail |
---|
public PartyNode()
public PartyNode(Move lastMove)
lastMove
- the move transforming the parent node's position to this node's positionMethod Detail |
---|
public void addVariant(PartyNode next)
next
- the node after the next variantpublic void addPV(PartyNode next)
next
- public boolean hasPV()
public PartyNode getPV()
public Move getMove()
public int getId()
public String getComment()
public void setComment(String comment)
comment
- the comment if any or null in order to erase an existing comment.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |