Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.rd.graph
Class Graph

    java.lang.Object
      |
      +--com.solarmetric.rd.graph.Graph

public class Graph
extends java.lang.Object

Graph representation using the adjacency list form. See the book 'Introduction to Algorithms' by Cormen, Leiserson, and Rivest.

Constructor Summary
`Graph()`

Method Summary
`void` | `addEdge(com.solarmetric.rd.graph.Edge edge)` Add an edge to the graph.
`void` | `addNode(java.lang.Object node)` Add a node to the graph.
`void` | `clear()` Clear the graph.
`boolean` | `containsNode(java.lang.Object node)` Return true if the graph contains the given node.
`com.solarmetric.rd.graph.Edge[]` | `getEdges()` Return all edges in the graph.
`com.solarmetric.rd.graph.Edge[]` | `getEdges(java.lang.Object from, java.lang.Object to)` Return all the edges from one node to another.
`com.solarmetric.rd.graph.Edge[]` | `getEdgesFrom(java.lang.Object node)` Return all the edges from a particular node.
`com.solarmetric.rd.graph.Edge[]` | `getEdgesTo(java.lang.Object node)` Return all the edges to a particular node.
`java.lang.Object[]` | `getNodes()` Return all nodes in the graph.
`boolean` | `removeEdge(com.solarmetric.rd.graph.Edge edge)` Remove an edge from the graph.
`boolean` | `removeNode(java.lang.Object node)` Remove a node from the graph.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Graph

    public Graph()

Method Detail

### clear

    public void clear()

  Clear the graph.

### containsNode

    public boolean containsNode(java.lang.Object node)

  Return true if the graph contains the given node.

### getNodes

    public java.lang.Object[] getNodes()

  Return all nodes in the graph.

### addNode

    public void addNode(java.lang.Object node)

  Add a node to the graph. Adding a node a second time has no effect.

### removeNode

    public boolean removeNode(java.lang.Object node)

  Remove a node from the graph. All edges to and from the node will be cleared.

  Returns:
    true if the node was removed, false otherwise

### getEdges

    public com.solarmetric.rd.graph.Edge[] getEdges()

  Return all edges in the graph.

### getEdgesFrom

    public com.solarmetric.rd.graph.Edge[] getEdgesFrom(java.lang.Object node)

  Return all the edges from a particular node.

### getEdgesTo

    public com.solarmetric.rd.graph.Edge[] getEdgesTo(java.lang.Object node)

  Return all the edges to a particular node.

### getEdges

    public com.solarmetric.rd.graph.Edge[] getEdges(java.lang.Object from,
                                                    java.lang.Object to)

  Return all the edges from one node to another.

### addEdge

    public void addEdge(com.solarmetric.rd.graph.Edge edge)

  Add an edge to the graph.

### removeEdge

    public boolean removeEdge(com.solarmetric.rd.graph.Edge edge)

  Remove an edge from the graph.

  Returns:
    true if the edge was removed, false if not in the graph

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.