com.oanda.fxtrade.api
Class FXEvent

java.lang.Object
  extended by com.oanda.fxtrade.api.FXEvent
Direct Known Subclasses:
FXAccountEvent, FXRateEvent

public abstract class FXEvent
extends java.lang.Object

FXEvent is the abstract superclass of all events.

Author:
Chris MacGregor

Constructor Summary
FXEvent()
          Default constructor.
FXEvent(boolean t)
          Optional constructor to specify the transient flag.
 
Method Summary
abstract  FXEventKey getKey()
          Gets the key for this event.
abstract  void handle(FXEventInfo EI, FXEventManager EM)
          The handle method is called once for each FXEventInfo which results in the match method returning true.
 boolean isTransient()
          Querys whether this event is transient (will only have its handle method called once).
abstract  boolean match(FXEventInfo EI)
          The match method is used to determine whether the handle method of this event should be called for the given FXEventInfo.
 void setTransient(boolean b)
          Set whether this event is transient (will only have its handle method called once).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FXEvent

public FXEvent()
Default constructor. Sets the transient flag to false.


FXEvent

public FXEvent(boolean t)
Optional constructor to specify the transient flag.

Parameters:
t - The value to set this event's transient flag to
Method Detail

getKey

public abstract FXEventKey getKey()
Gets the key for this event.

Returns:
The FXEventKey used to match this FXEvent to an FXEventInfo

setTransient

public void setTransient(boolean b)
Set whether this event is transient (will only have its handle method called once).

Parameters:
b - The value to set the transient flag to

isTransient

public boolean isTransient()
Querys whether this event is transient (will only have its handle method called once).

Returns:
True if this event is transient, false otherwise

match

public abstract boolean match(FXEventInfo EI)
The match method is used to determine whether the handle method of this event should be called for the given FXEventInfo.

Parameters:
EI - The FXEventInfo which is being matched
Returns:
True if the handle method should be called for the given FXEventInfo, false otherwise

handle

public abstract void handle(FXEventInfo EI,
                            FXEventManager EM)
The handle method is called once for each FXEventInfo which results in the match method returning true. Users must override this method to specify what they want their programs to do when a relevant event occurrs.

Parameters:
EI - The event info which fired this event
EM - The event manager which contains this event


Copyright © 2005 OANDA Corporation. All Rights Reserved.