infovis.graph
Class HierarchicalGraph

java.lang.Object
  extended by infovis.graph.DefaultGraph
      extended by infovis.graph.HierarchicalGraph
All Implemented Interfaces:
Graph, Metadata, Constants, EventListener, TableModelListener

public class HierarchicalGraph
extends DefaultGraph

Graph with vertices being a tree

Version:
$Revision: 1.5 $
Author:
Jean-Daniel Fekete

Field Summary
 
Fields inherited from class infovis.graph.DefaultGraph
FIRSTEDGE_COLUMN, FIRSTINEDGE_COLUMN, GRAPH_METADATA, INVERTEX_COLUMN, LASTEDGE_COLUMN, LASTINEDGE_COLUMN, NEXTEDGE_COLUMN, NEXTINEDGE_COLUMN, OUTVERTEX_COLUMN, PREVEDGE_COLUMN, PREVINEDGE_COLUMN
 
Fields inherited from interface infovis.Graph
GRAPH_TYPE, GRAPH_TYPE_DIRECTED, GRAPH_TYPE_UNDIRECTED, NIL
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
HierarchicalGraph()
           
 
Method Summary
 int addVertex()
          Adds a new vertex to the graph.
 int addVertex(int parent)
           
 void clear()
          Clears the Graph.
 Tree getTree()
           
 int getVerticesCount()
          Returns the number of vertices in the graph
 void removeVertex(int vertex)
          Removes the specified vertex from the graph.
 RowIterator vertexIterator()
          Returns an iterator over the vertices of the graph.
 
Methods inherited from class infovis.graph.DefaultGraph
addEdge, addGraphChangedListener, edgeIterator, edgeIterator, findEdge, getClientProperty, getDegree, getEdge, getEdgesCount, getEdgeTable, getFirstVertex, getGraph, getInDegree, getInEdgeAt, getMetadata, getName, getOtherVertex, getOutDegree, getOutEdgeAt, getSecondVertex, getVertexTable, inEdgeIterator, isDirected, outEdgeIterator, removeEdge, removeGraphChangedListener, setDirected, setName, tableChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalGraph

public HierarchicalGraph()
Method Detail

clear

public void clear()
Description copied from interface: Graph
Clears the Graph.

After this method, the graph tables are almost in the same state as if it had been created afresh except it contains the same columns as before but they are all cleared.

Specified by:
clear in interface Graph
Overrides:
clear in class DefaultGraph

addVertex

public int addVertex()
Description copied from class: DefaultGraph
Adds a new vertex to the graph.

Specified by:
addVertex in interface Graph
Overrides:
addVertex in class DefaultGraph
Returns:
the vertex number.

addVertex

public int addVertex(int parent)

removeVertex

public void removeVertex(int vertex)
Description copied from interface: Graph
Removes the specified vertex from the graph.

Specified by:
removeVertex in interface Graph
Overrides:
removeVertex in class DefaultGraph
Parameters:
vertex - the vertex to remove

getTree

public Tree getTree()

getVerticesCount

public int getVerticesCount()
Description copied from class: DefaultGraph
Returns the number of vertices in the graph

Specified by:
getVerticesCount in interface Graph
Overrides:
getVerticesCount in class DefaultGraph
Returns:
The number of vertices in the graph.

vertexIterator

public RowIterator vertexIterator()
Description copied from interface: Graph
Returns an iterator over the vertices of the graph.

Specified by:
vertexIterator in interface Graph
Overrides:
vertexIterator in class DefaultGraph
Returns:
an iterator over the vertices of the graph


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.