de.hpi.fgis.dude.postprocessor
Class WarshallTransitiveClosureGenerator.GraphRepresentation

java.lang.Object
  extended by de.hpi.fgis.dude.postprocessor.WarshallTransitiveClosureGenerator.GraphRepresentation
Direct Known Subclasses:
WarshallTransitiveClosureGenerator.AdjacencyList, WarshallTransitiveClosureGenerator.AdjacencyMatrix
Enclosing class:
WarshallTransitiveClosureGenerator

protected abstract class WarshallTransitiveClosureGenerator.GraphRepresentation
extends Object

WarshallTransitiveClosureGenerator.GraphRepresentation is an interface that should be implemented by all classes representing a graph of duplicates.

Author:
Uwe Draisbach

Constructor Summary
protected WarshallTransitiveClosureGenerator.GraphRepresentation()
           
 
Method Summary
abstract  void calculateTransitiveClosure()
          Iterating over the matrix and searching for new connections between elements.
abstract  boolean elementIsSet(int i, int j)
          Checks whether there is an edge between the two elements in the graph (element is already set in the matrix).
(package private) abstract  int getSize()
          Returns the number of elements in the matrix.
 void populateGraph(HashSet<WarshallTransitiveClosureGenerator.IntPair> liste)
          Populates the graph.
abstract  void set(int i, int j)
          Sets elements (i, j) in the matrix to true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WarshallTransitiveClosureGenerator.GraphRepresentation

protected WarshallTransitiveClosureGenerator.GraphRepresentation()
Method Detail

getSize

abstract int getSize()
Returns the number of elements in the matrix.

Returns:
number of elements in the matrix

set

public abstract void set(int i,
                         int j)
Sets elements (i, j) in the matrix to true. As the matrix handles undirected edges, also element (j, i) is set to true.

Parameters:
i - Coordinate i in the matrix.
j - Coordinate j in the matrix.

elementIsSet

public abstract boolean elementIsSet(int i,
                                     int j)
Checks whether there is an edge between the two elements in the graph (element is already set in the matrix).

Parameters:
i - The number of the first element.
j - The number of the second element.
Returns:
true, if there is an edge between the two elements; otherwise false.

populateGraph

public void populateGraph(HashSet<WarshallTransitiveClosureGenerator.IntPair> liste)
Populates the graph. For each passed pair of elements, an edge in the graph is created.

Parameters:
liste - A list of integer pairs that represent the connections between the elements.

calculateTransitiveClosure

public abstract void calculateTransitiveClosure()
Iterating over the matrix and searching for new connections between elements. For each element it is set to which other elements there is a path in the graph.



Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.