de.hpi.fgis.dude.postprocessor
Class NaiveTransitiveClosureGenerator

java.lang.Object
  extended by de.hpi.fgis.dude.postprocessor.NaiveTransitiveClosureGenerator
All Implemented Interfaces:
Iterable<DuDeObjectPair>

public class NaiveTransitiveClosureGenerator
extends Object
implements Iterable<DuDeObjectPair>

NaiveTransitiveClosureGenerator implements the naive way of generating transitive closures. It is memory-based and not optimized in any sense (simple nested-for-loop approach). The transitive closures can be returned in two ways:

  1. Using getTransitiveClosures() - this will return a 2-dimensional collection with each DuDeObject listed in its transitive closure.
  2. Using the Iterator interface - this will return all DuDeObjectPairs.

Author:
Matthias Pohl, David Sonnabend

Nested Class Summary
protected  class NaiveTransitiveClosureGenerator.TransitiveClosure
          TransitiveClosure represents one transitive closure.
protected  class NaiveTransitiveClosureGenerator.TransitiveClosureIterator
          NaiveTransitiveClosureGenerator.TransitiveClosureIterator is used to iterate over all pairs collected or generated by the NaiveTransitiveClosureGenerator.
 
Constructor Summary
NaiveTransitiveClosureGenerator()
           
 
Method Summary
 void add(Collection<DuDeObjectPair> pairs)
          Adds a Collection of pairs to the NaiveTransitiveClosureGenerator.
 void add(DuDeObjectPair pair)
          Adds a pair to the NaiveTransitiveClosureGenerator.
 Collection<? extends Collection<DuDeObject>> getTransitiveClosures()
          Returns the transitive closures as a 2-dimensional collection.
 Iterator<DuDeObjectPair> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NaiveTransitiveClosureGenerator

public NaiveTransitiveClosureGenerator()
Method Detail

add

public void add(DuDeObjectPair pair)
Adds a pair to the NaiveTransitiveClosureGenerator.

Parameters:
pair - The pair that shall be added.

add

public void add(Collection<DuDeObjectPair> pairs)
Adds a Collection of pairs to the NaiveTransitiveClosureGenerator.

Parameters:
pairs - The pairs that shall be added.

getTransitiveClosures

public Collection<? extends Collection<DuDeObject>> getTransitiveClosures()
Returns the transitive closures as a 2-dimensional collection.

Returns:
The transitive closures.

iterator

public Iterator<DuDeObjectPair> iterator()
Specified by:
iterator in interface Iterable<DuDeObjectPair>


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