de.hpi.fgis.dude.postprocessor
Class NaiveTransitiveClosureGenerator.TransitiveClosure

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<DuDeObject>
          extended by de.hpi.fgis.dude.postprocessor.NaiveTransitiveClosureGenerator.TransitiveClosure
All Implemented Interfaces:
Iterable<DuDeObject>, Collection<DuDeObject>, Set<DuDeObject>
Enclosing class:
NaiveTransitiveClosureGenerator

protected class NaiveTransitiveClosureGenerator.TransitiveClosure
extends AbstractSet<DuDeObject>

TransitiveClosure represents one transitive closure.

Author:
Matthias Pohl

Constructor Summary
NaiveTransitiveClosureGenerator.TransitiveClosure(DuDeObjectPair firstPair)
          Initializes a NaiveTransitiveClosureGenerator.TransitiveClosure.
 
Method Summary
 void add(DuDeObjectPair pair)
          Adds the elements of the passed pair to the transitive closure.
 boolean contains(DuDeObject object)
          Checks whether the passed DuDeObject is already member of the transitive closure.
 boolean contains(DuDeObjectPair pair)
          Checks whether at least one element of the pair is already within this transitive closure.
 Iterator<DuDeObject> iterator()
           
 void merge(NaiveTransitiveClosureGenerator.TransitiveClosure closure)
          Merges the passed TransitiveClosure with the current one.
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray
 

Constructor Detail

NaiveTransitiveClosureGenerator.TransitiveClosure

public NaiveTransitiveClosureGenerator.TransitiveClosure(DuDeObjectPair firstPair)
Initializes a NaiveTransitiveClosureGenerator.TransitiveClosure.

Parameters:
firstPair - The first pair that will be added.
Method Detail

contains

public boolean contains(DuDeObjectPair pair)
Checks whether at least one element of the pair is already within this transitive closure.

Parameters:
pair - The pair whose elements shall be checked.
Returns:
true, if one of the elements is already member of the transitive closure; otherwise false.

contains

public boolean contains(DuDeObject object)
Checks whether the passed DuDeObject is already member of the transitive closure.

Parameters:
object - The DuDeObject that shall be checked.
Returns:
true, if this object is already member of the transitive closure; otherwise false.

add

public void add(DuDeObjectPair pair)
Adds the elements of the passed pair to the transitive closure. If one of the elements is already member of the transitive closure it won't be added a second time.

Parameters:
pair - The pair whose elements shall be added.

merge

public void merge(NaiveTransitiveClosureGenerator.TransitiveClosure closure)
Merges the passed TransitiveClosure with the current one.

Parameters:
closure - The TransitiveClosure that shall be merged with the current one.

iterator

public Iterator<DuDeObject> iterator()
Specified by:
iterator in interface Iterable<DuDeObject>
Specified by:
iterator in interface Collection<DuDeObject>
Specified by:
iterator in interface Set<DuDeObject>
Specified by:
iterator in class AbstractCollection<DuDeObject>

size

public int size()
Specified by:
size in interface Collection<DuDeObject>
Specified by:
size in interface Set<DuDeObject>
Specified by:
size in class AbstractCollection<DuDeObject>


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