|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.kit.DefaultRecord
public class DefaultRecord
The DefaultRecord
is a basic implementation of data record.
Field Summary | |
---|---|
protected boolean |
has_time
|
protected int |
id
|
protected DataIntField[] |
int_fields
|
protected java.lang.String |
name
|
protected DataObjField[] |
obj_fields
|
protected DataScheme |
scheme
|
Constructor Summary | |
---|---|
DefaultRecord(int id,
java.lang.String name,
boolean has_time,
DataIntField[] int_fields,
DataObjField[] obj_fields)
|
Method Summary | |
---|---|
int |
getId()
Returns identifier of this record. |
DataIntField |
getIntField(int index)
Returns Int-field by its index within this record. |
int |
getIntFieldCount()
Returns a number of Int-fields in this record. |
java.lang.String |
getName()
Returns name of this record. |
DataObjField |
getObjField(int index)
Returns Obj-field by its index within this record. |
int |
getObjFieldCount()
Returns a number of Obj-fields in this record. |
DataRecord |
getResultingRecord()
Returns actual DataRecord that shall be used for subscription. |
DataScheme |
getScheme()
Returns parent DataScheme of this field. |
boolean |
hasTime()
Determines if this record contains time coordinate. |
void |
readRecord(com.devexperts.io.BufferedInput in,
RecordBuffer buffer,
int cipher,
java.lang.String symbol)
Reads record from the specified input and adds it to the specified cursor. |
static void |
setParentReferences(DefaultRecord record)
|
void |
setScheme(DataScheme scheme)
Sets reference to parent data scheme. |
java.lang.String |
toString()
|
boolean |
update(RecordCursor from,
RecordCursor to)
Updates this record's field values in to cusor by values from cursor. |
void |
writeFields(com.devexperts.io.BufferedOutput out,
RecordCursor cursor)
Writes this record's field values in a binary form into a specified output byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected DataScheme scheme
protected final int id
protected final java.lang.String name
protected final boolean has_time
protected final DataIntField[] int_fields
protected final DataObjField[] obj_fields
Constructor Detail |
---|
public DefaultRecord(int id, java.lang.String name, boolean has_time, DataIntField[] int_fields, DataObjField[] obj_fields)
Method Detail |
---|
public void setScheme(DataScheme scheme)
java.lang.IllegalStateException
- if parent scheme already set to different instance.public static void setParentReferences(DefaultRecord record)
public java.lang.String toString()
toString
in class java.lang.Object
public DataScheme getScheme()
DataRecord
DataScheme
of this field.
getScheme
in interface DataRecord
public int getId()
DataRecord
DataScheme
.
It is also used for identification of data record in serialized form.
getId
in interface DataRecord
public java.lang.String getName()
DataRecord
DataScheme
.
It is recommended that full names of record's fields contain record name
as a prefix like these: "FooRecord.Category", "FooRecord.Amount", etc.
getName
in interface DataRecord
public boolean hasTime()
DataRecord
hasTime
in interface DataRecord
public int getIntFieldCount()
DataRecord
getIntFieldCount
in interface DataRecord
public DataIntField getIntField(int index)
DataRecord
getIntField
in interface DataRecord
public int getObjFieldCount()
DataRecord
getObjFieldCount
in interface DataRecord
public DataObjField getObjField(int index)
DataRecord
getObjField
in interface DataRecord
public boolean update(RecordCursor from, RecordCursor to)
DataRecord
to
cusor by values from
cursor.
This method is used for implementation of ticker contract.
update
in interface DataRecord
true
if any values were updated and listeners shall be notified on data change.public void writeFields(com.devexperts.io.BufferedOutput out, RecordCursor cursor) throws java.io.IOException
DataRecord
DataIntField.writeInt(java.io.DataOutput, int)
and
DataObjField.writeObj(java.io.DataOutput, Object)
.
EXPERIMENTAL: This method is not actually used yet.
writeFields
in interface DataRecord
java.io.IOException
public final void readRecord(com.devexperts.io.BufferedInput in, RecordBuffer buffer, int cipher, java.lang.String symbol) throws java.io.IOException
RecordReader
DataRecord
implementation of this method reads the record itself,
but other implementations might perform complex transformations or do not read
anything at all.
readRecord
in interface RecordReader
java.io.IOException
public final DataRecord getResultingRecord()
RecordReader
null
if this reader does not actually read anything. DataRecord
implementation of this method
returns this
.
getResultingRecord
in interface RecordReader
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |