com.isti.util
Class TimeEventQueue

java.lang.Object
  extended by com.isti.util.TimeEventQueue

public class TimeEventQueue
extends java.lang.Object

Class TimeEventQueue defines a queue of time-event values.


Field Summary
protected  java.util.Vector queueVectorObj
           
 
Constructor Summary
TimeEventQueue()
          Creates a queue of time-event values.
 
Method Summary
 void addEvent(long timeVal)
          Adds a time-event value to the end of the queue.
 boolean checkPullNextEvent()
          Determines if the current system time is at or after the next time-event value in the queue (and removes it if so).
 boolean checkPullNextEvent(long currentTimeVal)
          Determines if the given current-time value is at or after the next time-event value in the queue (and removes it if so).
 int getEventQueueSize()
          Returns the current size of the time-event queue.
 long peekNextEvent()
          Returns the next time-event value from the queue.
 long pullNextEvent()
          Removes and returns the next time-event value from the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queueVectorObj

protected final java.util.Vector queueVectorObj
Constructor Detail

TimeEventQueue

public TimeEventQueue()
Creates a queue of time-event values.

Method Detail

addEvent

public void addEvent(long timeVal)
Adds a time-event value to the end of the queue.

Parameters:
timeVal - time-event value.

checkPullNextEvent

public boolean checkPullNextEvent(long currentTimeVal)
Determines if the given current-time value is at or after the next time-event value in the queue (and removes it if so). Multiple time-event values may be removed from the queue if the current-time value is at or after them.

Parameters:
currentTimeVal - current-time value to use.
Returns:
true if the given current-time value is at or after the next time-event value in the queue; false if not.

checkPullNextEvent

public boolean checkPullNextEvent()
Determines if the current system time is at or after the next time-event value in the queue (and removes it if so). Multiple time-event values may be removed from the queue if the current system time value is at or after them.

Returns:
true if the current system time is at or after the next time-event value in the queue; false if not.

peekNextEvent

public long peekNextEvent()
Returns the next time-event value from the queue. The queue is left unchanged.

Returns:
The next time-event value from the queue, or 0 if none available.

pullNextEvent

public long pullNextEvent()
Removes and returns the next time-event value from the queue.

Returns:
The next time-event value from the queue, or 0 if none available.

getEventQueueSize

public int getEventQueueSize()
Returns the current size of the time-event queue.

Returns:
The current size of the time-event queue.