jAER project on SourceForge

net.sf.jaer.event
Class BasicEvent

java.lang.Object
  extended by net.sf.jaer.event.BasicEvent
All Implemented Interfaces:
EventInterface<BasicEvent>
Direct Known Subclasses:
TypedEvent

public class BasicEvent
extends java.lang.Object
implements EventInterface<BasicEvent>

Base class for events. This class is extended by producers offering extended event type information. Instances are used in EventPacket. This class is the new-style event that replaces the original Event2D.

Author:
tobi

Field Summary
 int timestamp
          timestamp of event, by convention in us
 short x
          x address of event (horizontal coordinate, by convention starts at left of image)
 short y
          y address of event (vertical coordinate, by convention starts at bottom of image)
 
Constructor Summary
BasicEvent()
          Creates a new instance of BasicEvent
BasicEvent(int t)
          Creates a new instance of BasicEvent
BasicEvent(int timestamp, short x, short y, byte type, byte... types)
          create an BasicEvent with a timestamp, x, y, and a variable length number of bytes types
 
Method Summary
 void copyFrom(BasicEvent e)
          copies fields from source event src to this event
 int getNumCellTypes()
          Returns the number of types this type of event has, e.g.
 int getTimestamp()
           
 int getType()
          Returns the int type of the event, by convention starting with 0
 short getX()
           
 short getY()
           
 void setTimestamp(int timestamp)
           
 void setX(short x)
           
 void setY(short y)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timestamp

public int timestamp
timestamp of event, by convention in us


x

public short x
x address of event (horizontal coordinate, by convention starts at left of image)


y

public short y
y address of event (vertical coordinate, by convention starts at bottom of image)

Constructor Detail

BasicEvent

public BasicEvent()
Creates a new instance of BasicEvent


BasicEvent

public BasicEvent(int timestamp,
                  short x,
                  short y,
                  byte type,
                  byte... types)
create an BasicEvent with a timestamp, x, y, and a variable length number of bytes types


BasicEvent

public BasicEvent(int t)
Creates a new instance of BasicEvent

Method Detail

copyFrom

public void copyFrom(BasicEvent e)
copies fields from source event src to this event

Specified by:
copyFrom in interface EventInterface<BasicEvent>
Parameters:
e - the event to copy from

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNumCellTypes

public int getNumCellTypes()
Description copied from interface: EventInterface
Returns the number of types this type of event has, e.g. 2 for a PolarityEvent or 4 for an OrientationEvent

Specified by:
getNumCellTypes in interface EventInterface<BasicEvent>
Returns:
number of types

getType

public int getType()
Description copied from interface: EventInterface
Returns the int type of the event, by convention starting with 0

Specified by:
getType in interface EventInterface<BasicEvent>
Returns:
the type

getTimestamp

public final int getTimestamp()

setTimestamp

public final void setTimestamp(int timestamp)

getX

public final short getX()

setX

public final void setX(short x)

getY

public final short getY()

setY

public final void setY(short y)

jAER project on SourceForge