Class SGFLeaf


  • public final class SGFLeaf
    extends java.lang.Object
    Contains 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).
    • Constructor Summary

      Constructors 
      Constructor Description
      SGFLeaf​(SGFToken token)
      Creates a new SGFLeaf, with at least one token.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addToken​(SGFToken token)
      Adds a token to this leaf; usually this will be a move that was played in the game.
      java.util.Enumeration getTokens()
      Returns the tokens housed by this leaf.
      void removeToken​(SGFToken token)
      Removes a token from this leaf; useful for deleting comments and board mark-up.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.