|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ch.odi.common.graphs.HashGraph
Title: Thread safe implementation of a graph with hashtables. Description: Copyright: Copyright (c) 2002 Ortwin Glück Company:
| Constructor Summary | |
HashGraph()
|
|
| Method Summary | |
void |
addConnection(Object node1,
Object node2)
Creates a connection between two nodes in a graph. |
void |
addNode(Object node,
Object neighbour)
Adds a node to the graph. |
boolean |
contains(Object node)
Checks if a node is in the graph. |
List |
getNeighbours(Object node)
Gets all nodes connected to the specified node. |
Set |
getNodes()
Gets all the nodes in the graph. |
boolean |
isConnected(Object node1,
Object node2)
Checks if two nodes are connected. |
boolean |
isEmpty()
Checks if the graph contains any nodes. |
void |
removeConnection(Object node1,
Object node2)
Removes a connection between two nodes. |
void |
removeNode(Object node)
Removes a node and all its connections from the graph. |
int |
size()
Gets the number of nodes in the graph. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public HashGraph()
| Method Detail |
public void addNode(Object node,
Object neighbour)
throws GraphException
node is already a member of the
graph a connection is created and no exception is thrown.node - The node to addneighbour - A neighbour of the new node that is already a member of
the graph. If you add a node to an empty graph this parameter is ignored.public void removeNode(Object node)
public boolean contains(Object node)
public boolean isEmpty()
public void addConnection(Object node1,
Object node2)
public void removeConnection(Object node1,
Object node2)
throws LastConnectionException
public List getNeighbours(Object node)
public Set getNodes()
public boolean isConnected(Object node1,
Object node2)
public int size()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||