choco.cp.solver.propagation
Class ObservableVarEventQueue

java.lang.Object
  extended by choco.cp.solver.propagation.VariableEventQueue
      extended by choco.cp.solver.propagation.ObservableVarEventQueue
All Implemented Interfaces:
IObservable, EventQueue

public class ObservableVarEventQueue
extends VariableEventQueue
implements IObservable


Field Summary
 
Fields inherited from class choco.cp.solver.propagation.VariableEventQueue
lastPopped, queue
 
Fields inherited from interface choco.kernel.solver.propagation.queue.EventQueue
LOGGER
 
Constructor Summary
ObservableVarEventQueue()
           
 
Method Summary
 void addObserver(IObserver o)
          Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set.
 void clear()
          Clear datastructures for safe reuses
 void flushEventQueue()
          Removes all the events (including the popping one).
 void notifyObservers(Object arg)
          If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.
 PropagationEvent popEvent()
          Pops an event to propagate.
 boolean pushEvent(PropagationEvent event)
          Adds an event to the queue.
 
Methods inherited from class choco.cp.solver.propagation.VariableEventQueue
get, isEmpty, propagateAllEvents, propagateOneEvent, remove, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservableVarEventQueue

public ObservableVarEventQueue()
Method Detail

clear

public void clear()
Clear datastructures for safe reuses

Specified by:
clear in interface EventQueue
Overrides:
clear in class VariableEventQueue

popEvent

public PropagationEvent popEvent()
Pops an event to propagate.

Specified by:
popEvent in interface EventQueue
Overrides:
popEvent in class VariableEventQueue

pushEvent

public boolean pushEvent(PropagationEvent event)
Adds an event to the queue.

Specified by:
pushEvent in interface EventQueue
Overrides:
pushEvent in class VariableEventQueue

flushEventQueue

public void flushEventQueue()
Removes all the events (including the popping one).

Specified by:
flushEventQueue in interface EventQueue
Overrides:
flushEventQueue in class VariableEventQueue

addObserver

public void addObserver(IObserver o)
Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set. The order in which notifications will be delivered to multiple observers is not specified. See the class comment.

Specified by:
addObserver in interface IObservable
Parameters:
o - an observer to be added.
Throws:
NullPointerException - if the parameter o is null.

notifyObservers

public void notifyObservers(Object arg)
If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.

Each observer has its update method called with two arguments: this observable object and the arg argument.

Specified by:
notifyObservers in interface IObservable
Parameters:
arg - any object.
See Also:
IObserver.update(choco.IObservable , Object)


Copyright © 2012. All Rights Reserved.