visidia.simulation.process.criterion
Class DoorPulseCriterion

java.lang.Object
  extended by visidia.simulation.process.criterion.DoorPulseCriterion
All Implemented Interfaces:
Criterion

public class DoorPulseCriterion
extends java.lang.Object
implements Criterion

allows to retrieve a message from a node queue according to the pulse and/or door number. This class is used in the SyncAlgorithm to filter messages and allows the user to get messages according to a given pulse and/or door.


Constructor Summary
DoorPulseCriterion()
          the door and the pulse are ignored. matches any messagePacket.
DoorPulseCriterion(int pulse)
          the door is ignored. matches any messagePacket sent at the given pulse.
DoorPulseCriterion(int door, int pulse)
          matches any messagePacket sent at the given pulse and arrived at the given port.
 
Method Summary
 boolean doorIsNull()
           
 int getDoor()
           
 int getPulse()
           
 boolean isMatchedBy(java.lang.Object o)
          return true if the object o is instance of a MessagePacket object and if the door and pulse of the MessagePacket object o match respectively the door and pulse of this object, otherwise return false.
 boolean pulseIsNull()
           
 void setDoor(int door)
          set the door in the criterion.
 void setPulse(int pulse)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoorPulseCriterion

public DoorPulseCriterion()
the door and the pulse are ignored. matches any messagePacket.


DoorPulseCriterion

public DoorPulseCriterion(int pulse)
the door is ignored. matches any messagePacket sent at the given pulse.


DoorPulseCriterion

public DoorPulseCriterion(int door,
                          int pulse)
matches any messagePacket sent at the given pulse and arrived at the given port.

Method Detail

isMatchedBy

public boolean isMatchedBy(java.lang.Object o)
return true if the object o is instance of a MessagePacket object and if the door and pulse of the MessagePacket object o match respectively the door and pulse of this object, otherwise return false. If the door (resp. the pulse) of the criterion is not specified (null) then the message packet door (resp. pulse) number is not taken into account.

Specified by:
isMatchedBy in interface Criterion
Parameters:
o - the object
Returns:
true, if criterion is satisfied

getPulse

public int getPulse()

getDoor

public int getDoor()

setDoor

public void setDoor(int door)
set the door in the criterion. This enables to create a criterion where the pulse is ignored (use the default constructor and then set the door). This is never done in the SyncAlgorithm class but the user may use it.


setPulse

public void setPulse(int pulse)

pulseIsNull

public boolean pulseIsNull()

doorIsNull

public boolean doorIsNull()