com.lightstreamer.interfaces.data
Interface ItemEvent


public interface ItemEvent

Provides to the Data Adapter a base interface for creating ItemEvents in order to send updates to Lightstreamer Kernel. An ItemEvent object contains the new values and, in some cases, the current values of the Fields of an Item. The interfaces OldItemEvent, IndexedItemEvent and java.util.Map may also be used to define events. Events of all these kinds may be freely mixed, even if they belong to the same Item. All implementation methods should be nonblocking.

See Also:
OldItemEvent, IndexedItemEvent

Method Summary
 java.util.Iterator getNames()
          Returns an iterator to browse the names of the supplied Fields, expressed as String.
 java.lang.Object getValue(java.lang.String name)
          Returns the value of a named Field (null is a legal value too).
 

Method Detail

getNames

java.util.Iterator getNames()
Returns an iterator to browse the names of the supplied Fields, expressed as String. If the Item to which this ItemEvent refers has been subscribed by setting the needsIterator flag as false, the method can return a null value.

Returns:
an iterator, or null.
See Also:
DataProvider

getValue

java.lang.Object getValue(java.lang.String name)
Returns the value of a named Field (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, the latter case being the most efficient, though restricted to the ISO-8859-1 (ISO-LATIN-1) character set. Lightstreamer Kernel will call this method at most once for each Field (unless events logging is enabled) and may not call this method at all for some Fields. So, if performing any data conversion is required in order to extract Field values, it may be convenient to do it on demand rather than doing it in advance.

Parameters:
name - A Field name.
Returns:
a String or a byte array containing the Field value, or null.
See Also:
ItemEventListener