choco.prop
Interface EventQueue

All Known Implementing Classes:
ConstraintEventQueue, PalmVarEventQueue, VarEventQueue

public interface EventQueue

An interface for all the implementations of var queues (Constraint awake, on Variable events for instance).


Method Summary
 void flushEventQueue()
          Removes all the events and clears all the events if needed.
 PropagationEvent get(int idx)
          returns the i-th pending event in the queue
 boolean isEmpty()
          Checks if the queue is empty.
 PropagationEvent popEvent()
          Pops the next var to propagate.
 void propagateOneEvent()
          Propagate one single event from the queue).
 void propagateSomeEvents()
          Propagate some events (one or several depending on the queue).
 boolean pushEvent(PropagationEvent event)
          Adds an event to the queue.
 void remove(PropagationEvent event)
          Removes an event.
 int size()
          returns the number of pending events in the queue
 

Method Detail

isEmpty

boolean isEmpty()
Checks if the queue is empty.


popEvent

PropagationEvent popEvent()
Pops the next var to propagate.


pushEvent

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

Parameters:
event -

flushEventQueue

void flushEventQueue()
Removes all the events and clears all the events if needed.


remove

void remove(PropagationEvent event)
Removes an event.


propagateSomeEvents

void propagateSomeEvents()
                         throws ContradictionException
Propagate some events (one or several depending on the queue).

Throws:
ContradictionException

propagateOneEvent

void propagateOneEvent()
                       throws ContradictionException
Propagate one single event from the queue).

Throws:
ContradictionException

size

int size()
returns the number of pending events in the queue

Returns:
the number of pending events in the queue

get

PropagationEvent get(int idx)
returns the i-th pending event in the queue

Parameters:
idx - the index of the event
Returns:
null if the index is inproper (idx<0 or idx>=size())