com.newisys.eventsim
Class AnyEvent

java.lang.Object
  extended by com.newisys.eventsim.Event
      extended by com.newisys.eventsim.StepEvent
          extended by com.newisys.eventsim.MetaEvent
              extended by com.newisys.eventsim.AnyEvent

public final class AnyEvent
extends MetaEvent

A MetaEvent which occurs once any of its constituent events have occurred.


Field Summary
 
Fields inherited from class com.newisys.eventsim.StepEvent
ALWAYS, NEVER
 
Constructor Summary
AnyEvent(Collection<? extends Event> events, boolean autoReset)
          Creates a new AnyEvent from the collection specified.
AnyEvent(String name, Collection<? extends Event> events, boolean autoReset)
          Creates a new AnyEvent from the collection specified.
 
Method Summary
 boolean hasOccurred()
          Return whether or not this AnyEvent has occurred.
 
Methods inherited from class com.newisys.eventsim.MetaEvent
isAutoReset
 
Methods inherited from class com.newisys.eventsim.Event
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnyEvent

public AnyEvent(Collection<? extends Event> events,
                boolean autoReset)
Creates a new AnyEvent from the collection specified. If autoReset is true, the event will be reset after it has been satisfied.

Parameters:
events - a Collection of events that can occur for this AnyEvent to be satisfied
autoReset - true if this event should be reset after it has been satisfied, false otherwise

AnyEvent

public AnyEvent(String name,
                Collection<? extends Event> events,
                boolean autoReset)
Creates a new AnyEvent from the collection specified. If autoReset is true, the event will be reset after it has been satisfied.

Parameters:
name - the name of this AnyEvent
events - a Collection of events that can occur for this AnyEvent to be satisfied
autoReset - true if this event should be reset after it has been satisfied, false otherwise
Method Detail

hasOccurred

public boolean hasOccurred()
Return whether or not this AnyEvent has occurred. An AnyEvent is considered to have occurred when any of its constituent events has occurred.

Overrides:
hasOccurred in class StepEvent
Returns:
true if this AnyEvent has occurred, false otherwise