public class SpikeEventQueue extends java.util.concurrent.PriorityBlockingQueue<SpikeEvent>
Queue holding SpikeEvent objects, ordered according to their
timestamps. The element with the lowest timestamp is the head of the queue.
Every SpikeEventQueue has a property horizon.
The method update(double) compares the timestamp of each element
to the specified value and removes any element where the difference
is higher than the horizon.
| Constructor and Description |
|---|
SpikeEventQueue()
Create a new
SpikeEventQueue, with an infinite horizon. |
SpikeEventQueue(double horizon)
Create a new
SpikeEventQueue, with the specified horizon. |
| Modifier and Type | Method and Description |
|---|---|
double |
getHorizon()
Return the horizon of this queue.
|
void |
setHorizon(double horizon)
Set the horizon of this queue.
|
java.lang.String |
toString() |
void |
update(double time)
Compare the timestamp of each element to the specified value and
remove any element where the difference is higher than the horizon
of this queue.
|
add, clear, comparator, contains, drainTo, drainTo, iterator, offer, offer, peek, poll, poll, put, remainingCapacity, remove, size, spliterator, take, toArray, toArraycontainsAll, isEmpty, removeAll, retainAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic SpikeEventQueue()
SpikeEventQueue, with an infinite horizon.public SpikeEventQueue(double horizon)
SpikeEventQueue, with the specified horizon.horizon - the horizonpublic void update(double time)
time - the value to compare againstpublic double getHorizon()
public void setHorizon(double horizon)
public java.lang.String toString()
toString in class java.util.concurrent.PriorityBlockingQueue<SpikeEvent>