jAER project on SourceForge

net.sf.jaer.aemonitor
Class AEPacket

java.lang.Object
  extended by 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

Field Summary
protected  int capacity
           
protected  Event[] events
           
protected  int numEvents
           
 int[] timestamps
           
 
Constructor Summary
AEPacket()
           
 
Method Summary
 void addEvent(Event e)
           
 void clear()
          sets number of events to zero
 void ensureCapacity(int c)
          ensure the capacity given.
 int getCapacity()
           
 int getDt()
           
 int getFirstTimestamp()
           
 int getLastTimestamp()
           
 int getNumEvents()
           
 int getTimestamp(int n)
           
 int[] getTimestamps()
           
 void setNumEvents(int numEvents)
           
 void setTimestamps(int[] timestamps)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numEvents

protected int numEvents

capacity

protected int capacity

timestamps

public int[] timestamps

events

protected Event[] events
Constructor Detail

AEPacket

public AEPacket()
Method Detail

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


jAER project on SourceForge