|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.ualberta.cs.poker.free.server.TournamentTree
public class TournamentTree
DirectedGraph represents a directed graph that contain the structure of the single elimination tournament, which match to run and keep track of the outcome
Field Summary | |
---|---|
protected int |
curID
|
protected java.lang.String |
name
|
protected java.util.ArrayList |
nodes
|
Constructor Summary | |
---|---|
TournamentTree()
Creates an empty DirectedGraph. |
Method Summary | |
---|---|
void |
addEdge(Node source,
Node dest)
Adds a directed edge from the source Node to the dest Directed Node |
void |
addNode(Node n)
Adds the provided Node to this DirectedGraph |
protected void |
dfsVisit(Node u,
int[] color,
int[] pi,
java.util.ArrayList ret)
|
boolean |
existsEdge(int source_id,
int dest_id)
Determines if a directed edge exists from the source Node to this destination Node |
boolean |
existsEdge(Node source,
Node dest)
Determines if a directed edge exists from the source Node to this destination Node |
java.lang.String |
getName()
getName returns the name of the DirectedGraph |
Node |
getNode(int id)
getDirectedNode returns the Node from the DirectedGraph with the specified id. |
Node |
getRootNode()
|
java.util.List |
getRootNodes()
Returns a List containing all the root nodes (i.e. |
java.util.Iterator |
nodeIterator()
|
void |
removeEdge(Node source,
Node dest)
Removes the directed edge between the source Node and the destination Node |
void |
removeNode(Node n)
Removes the specified Node and it's associated edges from this DirectedGraph. |
void |
setName(java.lang.String string)
setName sets the name of the DirectedGraph to the specifed String value |
int |
size()
size returns the number of DirectedNodes in the DirectedGraph |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int curID
protected java.lang.String name
protected java.util.ArrayList nodes
Constructor Detail |
---|
public TournamentTree()
Method Detail |
---|
public void addEdge(Node source, Node dest)
source
- dest
- public java.util.List getRootNodes()
public Node getRootNode()
public void removeNode(Node n)
n
- the Node to be removed.public void removeEdge(Node source, Node dest)
source
- dest
- public boolean existsEdge(Node source, Node dest)
source
- dest
-
public boolean existsEdge(int source_id, int dest_id)
source_id
- the id of the source Nodedest_id
- the id of the destination Node
public void addNode(Node n)
n
- the Node to be addedpublic java.lang.String toString()
toString
in class java.lang.Object
protected void dfsVisit(Node u, int[] color, int[] pi, java.util.ArrayList ret)
public java.util.Iterator nodeIterator()
public Node getNode(int id)
id
- the unique id of the Node to be returned
public int size()
public java.lang.String getName()
public void setName(java.lang.String string)
string
- the name that the DirectedGraph is to be given
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |