Interface IndexedItemEvent


public interface IndexedItemEvent
Provides to the Data Adapter an alternative interface for creating ItemEvents in order to send updates to Lightstreamer Kernel. In this event, a name-index association is defined for all fields. These indexes will also be used to iterate through all the fields. Some indexes may not be associated to fields in the event, but the number of such holes should be small. The name-index associations are local to the event and may be different even across events belonging to the same Item. Using this kind of events allows a particularly efficient management of events that belong to Items requested in RAW, DISTINCT or COMMAND Mode.

All implementation methods must execute fast and must be nonblocking. All information needed to extract data must be provided at object construction. If the implementation were slow, the whole update delivery process, even for different sessions, would be slowed down.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the index of a named Field.
    int
    Returns the maximum index for the fields in the event.
    getName(int index)
    Returns the name of a Field whose index is supplied.
    getValue(int index)
    Returns the value of a field whose index is supplied (null is a legal value too).
  • Method Details

    • getMaximumIndex

      int getMaximumIndex()
      Returns the maximum index for the fields in the event. The event cannot be empty, so the maximum Index must always exist.
      Returns:
      a 0-based index.
    • getIndex

      int getIndex(@Nonnull String name)
      Returns the index of a named Field. Returns -1 if such a field is not reported in this event. Lightstreamer Kernel will call this method up to once for every distinct client request of the Item. So, the implementation must be very fast.
      Parameters:
      name - A Field name.
      Returns:
      a 0-based index for the field or -1. The index must not be greater than the maximum index returned by getMaximumIndex().
    • getName

      @Nullable String getName(int index)
      Returns the name of a Field whose index is supplied. Returns null if the Field is not reported in this event. If the Item to which this ItemEvent refers has been subscribed by setting the needsIterator flag as false, the method can always return a null value.
      Parameters:
      index - A Field index.
      Returns:
      the name of a Field, or null.
      See Also:
    • getValue

      @Nullable Object getValue(int index)
      Returns the value of a field whose index is supplied (null is a legal value too). Returns null if the Field is not reported in the ItemEvent.
      The value can be expressed as either a String or a byte array; see ItemEvent.getValue(String) for details.
      Parameters:
      index - A Field index.
      Returns:
      a String or a byte array containing the Field value, or null.