net.sf.jaer.aemonitor
Class AEPacket
java.lang.Object
net.sf.jaer.aemonitor.AEPacket
- Direct Known Subclasses:
- AEPacket3D, AEPacketRaw
public abstract class AEPacket
- extends java.lang.Object
The superclass for raw event packets, as captured from an AEMonitorInterface. These packets are not used for processed events.
- Author:
- tobi
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
numEvents
protected int numEvents
capacity
protected int capacity
timestamps
public int[] timestamps
events
protected Event[] events
AEPacket
public AEPacket()
getNumEvents
public int getNumEvents()
setNumEvents
public void setNumEvents(int numEvents)
getTimestamps
public int[] getTimestamps()
getTimestamp
public int getTimestamp(int n)
- Parameters:
n
- the index (0 based) of the timestamp
- Returns:
- the timestamp
getFirstTimestamp
public int getFirstTimestamp()
getLastTimestamp
public int getLastTimestamp()
getDt
public int getDt()
- Returns:
- time interval for packet - from first to last event, in timestamp ticks. Returns 0 if there are fewer than two events.
setTimestamps
public void setTimestamps(int[] timestamps)
getCapacity
public int getCapacity()
- Returns:
- the maximum capacity for holding events in the packet. Not the number of events present now.
ensureCapacity
public void ensureCapacity(int c)
- ensure the capacity given. If present capacity is less than capacity, then arrays are newly allocated and old contents are copied to the new arrays.
- Parameters:
c
- the desired capacity
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
addEvent
public void addEvent(Event e)
- Parameters:
e
- an Event to add to the ones already present. Capacity is enlarged if necessary.
clear
public void clear()
- sets number of events to zero