pedviz.graph
Class Hierarchy

java.lang.Object
  extended by pedviz.graph.Hierarchy

public class Hierarchy
extends java.lang.Object

This class represents the hierarchy of a graph. Every graph has one or more hierarchies.

Version:
0.1
Author:
Lukas Forer

Constructor Summary
Hierarchy(Graph graph)
          Creates a hierarchy for the given graph.
 
Method Summary
 void addNode(int level, Node node)
          Adds the given node at the given level to the hierarchy.
 int getLevelSize()
          Returns the number of different levels.
 java.util.HashMap<java.lang.Integer,java.util.ArrayList<Node>> getNodes()
           
 java.util.ArrayList<Node> getNodes(int level)
          Returns a collection of all nodes from the given level.
 void removeNode(Node node)
          Removes the given node from the hierarchy.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hierarchy

public Hierarchy(Graph graph)
Creates a hierarchy for the given graph.

Parameters:
graph -
Method Detail

addNode

public void addNode(int level,
                    Node node)
Adds the given node at the given level to the hierarchy.

Parameters:
level - level
node - node

removeNode

public void removeNode(Node node)
Removes the given node from the hierarchy.

Parameters:
node - node

getNodes

public java.util.ArrayList<Node> getNodes(int level)
Returns a collection of all nodes from the given level.

Parameters:
level - level
Returns:
a collection of all nodes from the given level.

getLevelSize

public int getLevelSize()
Returns the number of different levels.

Returns:

getNodes

public java.util.HashMap<java.lang.Integer,java.util.ArrayList<Node>> getNodes()