soc.robot
Class SOCTradeTree

java.lang.Object
  extended by soc.robot.SOCTradeTree

public class SOCTradeTree
extends java.lang.Object

This is a tree that contains possible trade offers and how they're related to each other. Also contains a flag for wheather or not this offer should be expanded to other offers.

Author:
Robert S. Thomas

Field Summary
(package private)  java.util.Vector<SOCTradeTree> children
           
(package private)  boolean needsToBeExpanded
           
(package private)  SOCTradeTree parent
           
(package private)  SOCResourceSet resourceSet
           
 
Constructor Summary
SOCTradeTree(SOCResourceSet set)
          this is a constructor
SOCTradeTree(SOCResourceSet set, SOCTradeTree par)
          this is a constructor
 
Method Summary
 void addChild(SOCTradeTree child)
          add a child to this node
 java.util.Vector<SOCTradeTree> getChildren()
           
 SOCTradeTree getParent()
           
 SOCResourceSet getResourceSet()
           
 boolean needsToBeExpanded()
           
 void setNeedsToBeExpanded(boolean value)
          set the needs to be expanded flag
 void setParent(SOCTradeTree p)
          set the parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceSet

SOCResourceSet resourceSet

parent

SOCTradeTree parent

children

java.util.Vector<SOCTradeTree> children

needsToBeExpanded

boolean needsToBeExpanded
Constructor Detail

SOCTradeTree

public SOCTradeTree(SOCResourceSet set,
                    SOCTradeTree par)
this is a constructor

Parameters:
set - the set of resources
par - the parent of this node

SOCTradeTree

public SOCTradeTree(SOCResourceSet set)
this is a constructor

Parameters:
set - the set of resources
Method Detail

getResourceSet

public SOCResourceSet getResourceSet()
Returns:
the resource set

getParent

public SOCTradeTree getParent()
Returns:
the parent

needsToBeExpanded

public boolean needsToBeExpanded()
Returns:
the needsToBeExpanded flag

getChildren

public java.util.Vector<SOCTradeTree> getChildren()
Returns:
the list of children

setParent

public void setParent(SOCTradeTree p)
set the parent

Parameters:
p - the parent node

setNeedsToBeExpanded

public void setNeedsToBeExpanded(boolean value)
set the needs to be expanded flag

Parameters:
value - the value of the flag

addChild

public void addChild(SOCTradeTree child)
add a child to this node

Parameters:
child - the node to be added