Provides information about a change to type 2 data in a record.
The RecordType2Event
is provided in an onRecordType2Update
callback
to a caplin.streamlink.SubscriptionListener.
Type 2 data is a 2-dimensional array, where the type 2 index acts as a row key, and the field-value pairs are column keys and values. This type of record is often used to represent a level 2 order book, for example:
Stock (type2Index) | BidSize | Bid | Ask | AskSize |
---|---|---|---|---|
ABN1 | 100 | 10.22 | 10.28 | 55 |
ZBN2 | 200 | 10.20 | 20.33 | 250 |
ARC | 1 | 10.16 | 10.41 | 1 |
When the type 2 data is updated, the new values are sent as a set of caplin.streamlink.RecordType2Events, one event for each row of the record that has changed.
Attributes | Name and Description |
---|---|
|
caplin.streamlink.RecordType2Event()
|
Attributes | Name and Description |
---|---|
|
boolean
deleteAllRows()
Returns whether all rows should be deleted. |
|
boolean
deleteRow()
Returns whether the row should be deleted. |
|
Object
getFields()
Returns the record fields relating to the event, as a collection of key-value pairs. |
|
String
getType2IndexField()
Gets the type 2 index field relating to the event. |
►
caplin.streamlink.RecordType2Event()
►
boolean
deleteAllRows()
Returns whether all rows should be deleted.
►
boolean
deleteRow()
Returns whether the row should be deleted.
►
Object
getFields()
Returns the record fields relating to the event, as a collection of key-value pairs.
When a call to isImage() returns true, the subscription data event contains an image of the data for the subscribed item. All the fields comprising the record are present in the collection. The application must discard any values previously received and replace them with the values contained within the collection.
When a call to isImage() returns false, the subscription data event contains new data for the subscribed record. The values in the collection returned are an update to any values previously received and any application caches should be updated appropriately.
►
String
getType2IndexField()
Gets the type 2 index field relating to the event.
A caplin.streamlink.RecordType2Event contains information about one row of the type 2 data. The row is identified by the value of the type 2 index fieldname returned by this method.