Class Event

java.lang.Object
org.sensorhub.api.event.Event
Direct Known Subclasses:
DeviceScanEvent, ModuleEvent, SystemEvent

public abstract class Event extends Object

Immutable base class for all sensor hub events. All sub-classes should remain immutable.

Since:
Nov 5, 2010
  • Field Details

    • timeStamp

      protected long timeStamp
    • source

      protected transient Object source
  • Constructor Details

    • Event

      public Event()
  • Method Details

    • getTimeStamp

      public long getTimeStamp()
      Returns:
      Time stamp of event creation (Unix time in ms since 1970)
    • getSourceID

      public abstract String getSourceID()
      Gets the ID of the source of event.
      Returns:
      ID of the event source
    • getSource

      public Object getSource()
      Gets the source of the event as an object reference.

      Note that this is not guaranteed to be available when using events in a distributed system.

      Returns:
      Source object that generated this event or null
    • toString

      public String toString()
      Overrides:
      toString in class Object