Class AttributeMonitor<Atom>
- java.lang.Object
-
- org.eclipse.viatra.transformation.evm.notification.AttributeMonitor<Atom>
-
- Direct Known Subclasses:
DefaultAttributeMonitor
,LightweightAttributeMonitor
public abstract class AttributeMonitor<Atom> extends java.lang.Object
The class defines the operations that are required to observe the EMF attribute changes on atom objects.
-
-
Constructor Summary
Constructors Constructor Description AttributeMonitor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAttributeMonitorListener(IAttributeMonitorListener<Atom> listener)
Registers a listener for notifications when a feature value of an object in a atom changes.void
dispose()
Disposes of the attribute monitor by unregistering from each atom.protected void
notifyListeners(Atom atom)
Sends notification to listeners when the given atom is updated.abstract void
registerFor(Atom atom)
Register the attribute monitor to watch feature values of object defined in the given atom.void
removeAttributeMonitorListener(IAttributeMonitorListener<Atom> listener)
Unregisters a listener registered byaddAttributeMonitorListener(IAttributeMonitorListener)
.abstract void
unregisterFor(Atom atom)
Remove the attribute monitor from watching the given atom.abstract void
unregisterForAll()
Remove the attribute monitor from watching registered atoms.
-
-
-
Method Detail
-
addAttributeMonitorListener
public void addAttributeMonitorListener(IAttributeMonitorListener<Atom> listener)
Registers a listener for notifications when a feature value of an object in a atom changes.The listener can be unregistered via
removeAttributeMonitorListener(IAttributeMonitorListener)
.- Parameters:
listener
-
-
removeAttributeMonitorListener
public void removeAttributeMonitorListener(IAttributeMonitorListener<Atom> listener)
Unregisters a listener registered byaddAttributeMonitorListener(IAttributeMonitorListener)
.- Parameters:
listener
-
-
registerFor
public abstract void registerFor(Atom atom)
Register the attribute monitor to watch feature values of object defined in the given atom.- Parameters:
atom
-
-
unregisterForAll
public abstract void unregisterForAll()
Remove the attribute monitor from watching registered atoms.
-
unregisterFor
public abstract void unregisterFor(Atom atom)
Remove the attribute monitor from watching the given atom.- Parameters:
atom
-
-
notifyListeners
protected void notifyListeners(Atom atom)
Sends notification to listeners when the given atom is updated.- Parameters:
match
-
-
dispose
public void dispose()
Disposes of the attribute monitor by unregistering from each atom. TODO should we clear the listener list?
-
-