Interface IndexedItemEvent


public interface IndexedItemEvent
Provides to the Data Adapter an alternative interface for creating Item Events 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 should be nonblocking.
  • Method Summary

    Modifier and Type Method Description
    int getIndex​(java.lang.String name)
    Returns the index of a named Field.
    int getMaximumIndex()
    Returns the maximum index for the fields in the event.
    java.lang.String getName​(int index)
    Returns the name of a Field whose index is supplied.
    java.lang.Object 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 java.lang.String name)
      Returns the index of a named Field. Returns -1 if such a field is not reported in this event. Lightstreamer Kernel, through the Remote Server, 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 java.lang.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.
      Parameters:
      index - A Field index.
      Returns:
      The name of a Field, or null.
    • getValue

      @Nullable java.lang.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 Item Event. The value can be expressed as either a String or a byte array, the latter case being the most efficient, though restricted to the ISO-8859-1 (ISO-LATIN-1) character set.
      Parameters:
      index - A Field index.
      Returns:
      A String or a byte array containing the Field value, or null.