fulmine.event
Class EventQueueItem<EVENT>

java.lang.Object
  extended by fulmine.event.EventQueueItem<EVENT>
Type Parameters:
EVENT - the event class that is wrapped

public final class EventQueueItem<EVENT>
extends Object

Wraps an event that is placed onto an event queue. This encapsulates timings of event creation to the microsecond.

Author:
Ramon Servadei

Field Summary
static ThreadLocal<Boolean> isStatisticsEvent
          Thread local for a thread to 'tag' an event being queued onto the IEventManager.queueEvent(fulmine.event.IEvent) as being a statistics event and should thus not log statistics about the event.
 
Constructor Summary
EventQueueItem(EVENT event)
          Construct the event queue item wrapping an event
 
Method Summary
 boolean equals(Object obj)
           
 long getCreateTimeMicro()
          Get the time this item was created in microseconds
 long getElapsedTimeMicro()
          Get the elapsed time in microseconds between now and when the item was created
 EVENT getEvent()
          Get the event
 int hashCode()
           
 boolean isStatisticsEvent()
          Determine if this event is a statistics event.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

isStatisticsEvent

public static ThreadLocal<Boolean> isStatisticsEvent
Thread local for a thread to 'tag' an event being queued onto the IEventManager.queueEvent(fulmine.event.IEvent) as being a statistics event and should thus not log statistics about the event.

Constructor Detail

EventQueueItem

public EventQueueItem(EVENT event)
Construct the event queue item wrapping an event

Parameters:
event - the event to wrap
Method Detail

getEvent

public EVENT getEvent()
Get the event

Returns:
the event

getCreateTimeMicro

public long getCreateTimeMicro()
Get the time this item was created in microseconds

Returns:
the time of creation in microseconds

isStatisticsEvent

public boolean isStatisticsEvent()
Determine if this event is a statistics event. These events should not have statistics logged (else we get into a recursive loop).

Returns:
true if this is a statistics event

getElapsedTimeMicro

public long getElapsedTimeMicro()
Get the elapsed time in microseconds between now and when the item was created

Returns:
the elapsed time in microseconds between now and when the item was created

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2009. All Rights Reserved.