Class RepresentativeElectionAlgorithm<T>
java.lang.Object
tools.refinery.interpreter.rete.itc.alg.representative.RepresentativeElectionAlgorithm<T>
- All Implemented Interfaces:
IGraphObserver<T>
- Direct Known Subclasses:
StronglyConnectedComponentAlgorithm
,WeaklyConnectedComponentAlgorithm
public abstract class RepresentativeElectionAlgorithm<T>
extends Object
implements IGraphObserver<T>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assignNewRepresentative
(T oldRepresentative, Set<T> set) void
dispose()
getComponent
(T representative) getRepresentative
(T node) protected abstract void
protected void
initializeSet
(Set<T> set) protected void
protected void
void
nodeDeleted
(T n) Used to notify when a node is deleted from the graph.void
nodeInserted
(T n) Used to notify when a node is inserted into the graph.protected void
notifyToObservers
(T node, T oldRepresentative, T newRepresentative) protected void
notifyToObservers
(T node, T representative, Direction direction) void
setObserver
(RepresentativeObserver<? super T> observer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tools.refinery.interpreter.rete.itc.igraph.IGraphObserver
edgeDeleted, edgeInserted
-
Field Details
-
graph
-
representatives
-
components
-
-
Constructor Details
-
RepresentativeElectionAlgorithm
-
-
Method Details
-
initializeComponents
protected abstract void initializeComponents() -
initializeSet
-
merge
-
merge
-
assignNewRepresentative
-
setObserver
-
getComponents
-
getRepresentative
-
getComponent
-
dispose
public void dispose() -
nodeInserted
Description copied from interface:IGraphObserver
Used to notify when a node is inserted into the graph.- Specified by:
nodeInserted
in interfaceIGraphObserver<T>
- Parameters:
n
- the node
-
nodeDeleted
Description copied from interface:IGraphObserver
Used to notify when a node is deleted from the graph.- Specified by:
nodeDeleted
in interfaceIGraphObserver<T>
- Parameters:
n
- the node
-
notifyToObservers
-
notifyToObservers
-