com.dxfeed.event
Interface TimeSeriesEvent

All Known Implementing Classes:
Candle, TimeAndSale

public interface TimeSeriesEvent

Represents time-series snapshots of some process that is evolving in time or actual events in some external system that have an associated time stamp and can be uniquely identified. For example, TimeAndSale events represent the actual sales that happen on a market exchange at specific time moments, while Candle events represent snapshots of aggregate information about trading over a specific time period.

Time-series events can be used with DXFeedTimeSeriesSubscription to receive a time-series history of past events. Time-series events are conflated based on unique event identifiers for each symbol. Event identifier is available via getEventId method. The history of past events retains only one (last) event for the given event identifier.

Classes that implement this interface may also implement LastingEvent interface, which makes it possible to use DXFeed.getLastEvent method to retrieve the last event for the corresponding symbol.


Method Summary
 long getEventId()
          Returns identifier of this event.
 long getTime()
          Returns timestamp of the event.
 

Method Detail

getEventId

long getEventId()
Returns identifier of this event. Event identifiers are unique within event symbol. Typically event identifier includes event time inside.

Implementation notes

The most common scheme for event ids is to set highest 32 bits of event identifier to event time stamp in seconds. The lowest 32 bits are then split as follows. Bits 22 to 31 encode milliseconds of time stamp, and bits 0 to 21 encode some kind of sequence number.

Ultimately, the scheme for event identifiers is specific for each even type. The actual classes for specific event types perform the corresponding encoding.

Returns:
unique event identifier.

getTime

long getTime()
Returns timestamp of the event. The timestamp is in milliseconds from midnight, January 1, 1970 UTC.

Returns:
timestamp of the event.
See Also:
System.currentTimeMillis()


Copyright © 2013 Devexperts. All Rights Reserved.