Package com.barrybecker4.ca.dj.jigo.sgf
Class SGFLeaf
- java.lang.Object
-
- com.barrybecker4.ca.dj.jigo.sgf.SGFLeaf
-
public final class SGFLeaf extends java.lang.ObjectContains all tokens for a particular node; it's an end-point for a game tree. Most nodes only have one token: the move they represent. However, since a move can have comments, board markup, and board settings, a class was required to put everything associated with a move under one roof (but this does not mean a move must always be associated with a leaf, that's just what happens more often than not).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToken(SGFToken token)Adds a token to this leaf; usually this will be a move that was played in the game.java.util.EnumerationgetTokens()Returns the tokens housed by this leaf.voidremoveToken(SGFToken token)Removes a token from this leaf; useful for deleting comments and board mark-up.
-
-
-
Constructor Detail
-
SGFLeaf
public SGFLeaf(SGFToken token)
Creates a new SGFLeaf, with at least one token.- Parameters:
token- - The first token in this leaf.
-
-
Method Detail
-
getTokens
public java.util.Enumeration getTokens()
Returns the tokens housed by this leaf.- Returns:
- An enumeration of this leaf's tokens.
-
addToken
public void addToken(SGFToken token)
Adds a token to this leaf; usually this will be a move that was played in the game.- Parameters:
token- - Information that must be added to the leaf.
-
removeToken
public void removeToken(SGFToken token)
Removes a token from this leaf; useful for deleting comments and board mark-up.- Parameters:
token- - Information that must be removed from the leaf.
-
-