com.devexperts.qd
Interface DataScheme

All Known Implementing Classes:
DefaultScheme

public interface DataScheme

The DataScheme defines overall scheme of data records and fields. It contains an indexed list of data records and provides quick access to them.

For the QD, the data scheme represents description of processed data. It shall be provided by some external entity (the APS), and it shall be constant throughout the lifetime of the QD systems.


Method Summary
 DataIntField findIntFieldByName(java.lang.String name)
          Returns Int-field by its name.
 DataObjField findObjFieldByName(java.lang.String name)
          Returns Obj-field by its name.
 DataRecord findRecordByName(java.lang.String name)
          Returns data record by its name.
 SymbolCodec getCodec()
          Returns symbol codec used in this scheme.
 DataRecord getRecord(int index)
          Returns data record by its index within this scheme.
 int getRecordCount()
          Returns number of records in this scheme.
<T> T
getService(java.lang.Class<T> service_class)
          Extension point for additional scheme-specific services.
 DataRecord readRecordIdentity(java.io.DataInput in)
          Deprecated. Record id is always and directly stored as compact int. This method should not be used.
 void writeRecordIdentity(java.io.DataOutput out, DataRecord record)
          Deprecated. Record id is always and directly stored as compact int. This method should not be used.
 

Method Detail

getCodec

SymbolCodec getCodec()
Returns symbol codec used in this scheme.


getRecordCount

int getRecordCount()
Returns number of records in this scheme.


getRecord

DataRecord getRecord(int index)
Returns data record by its index within this scheme. The record index in the scheme coincides with its identifier and is also used for identification of data record in serialized form.

Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getRecordCount()).

findRecordByName

DataRecord findRecordByName(java.lang.String name)
Returns data record by its name. Returns null if no such records exists.


findIntFieldByName

DataIntField findIntFieldByName(java.lang.String name)
Returns Int-field by its name. Returns null if no such fields exists.


findObjFieldByName

DataObjField findObjFieldByName(java.lang.String name)
Returns Obj-field by its name. Returns null if no such fields exists.


writeRecordIdentity

void writeRecordIdentity(java.io.DataOutput out,
                         DataRecord record)
                         throws java.io.IOException
Deprecated. Record id is always and directly stored as compact int. This method should not be used.

Writes specified data record identity into specified data output.

Throws:
java.io.IOException - as specified data output does.

readRecordIdentity

DataRecord readRecordIdentity(java.io.DataInput in)
                              throws java.io.InvalidObjectException,
                                     java.io.IOException
Deprecated. Record id is always and directly stored as compact int. This method should not be used.

Reads data record identity from specified data intput and returns it to the caller.

Throws:
java.io.InvalidObjectException - if required data record is not found in this data scheme.
java.io.IOException - as specified data input does.

getService

<T> T getService(java.lang.Class<T> service_class)
Extension point for additional scheme-specific services. The following services are now supported: This method returns null if no scheme-specific override for the corresponding service is found.

Default implementation in DefaultScheme is to use Services.createService(java.lang.Class, java.lang.ClassLoader, java.lang.String) with this scheme's class loader.