|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.kit.DefaultScheme
public class DefaultScheme
The DefaultScheme
is a basic implementation of data scheme.
It uses record identifier and CompactInt
format for record identity serialization.
Note, that this implementation works only with records that are derived from
DefaultRecord
class and fields that are derived from
AbstractDataIntField
and AbstractDataObjField
classes.
Field Summary | |
---|---|
protected SymbolCodec |
codec
|
protected DefaultRecord[] |
records
|
Constructor Summary | |
---|---|
DefaultScheme(SymbolCodec codec,
DataRecord[] records)
|
Method Summary | ||
---|---|---|
static DataScheme |
createFromProperties(java.util.Map properties,
java.lang.String prefix)
Deprecated. This method shall be moved to PropertyConfigurator or equivalent. |
|
AbstractDataIntField |
findIntFieldByName(java.lang.String name)
Returns Int-field by its name. |
|
AbstractDataObjField |
findObjFieldByName(java.lang.String name)
Returns Obj-field by its name. |
|
DefaultRecord |
findRecordByName(java.lang.String name)
Returns data record by its name. |
|
SymbolCodec |
getCodec()
Returns symbol codec used in this scheme. |
|
DefaultRecord |
getRecord(int index)
Returns data record by its index within this scheme. |
|
int |
getRecordCount()
Returns number of records in this scheme. |
|
|
getService(java.lang.Class<T> service_class)
Extension point for additional scheme-specific services. |
|
static void |
setParentReferences(DataScheme scheme)
Deprecated. No replacement. Just remove usages of this method. DefaultScheme(SymbolCodec, DataRecord[]) constructor now does it automatically. |
|
static void |
verifyScheme(DataScheme scheme)
Deprecated. No replacement. Just remove usages of this method. DefaultScheme(SymbolCodec, DataRecord[]) constructor does it all automatically. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final SymbolCodec codec
protected final DefaultRecord[] records
Constructor Detail |
---|
public DefaultScheme(SymbolCodec codec, DataRecord[] records)
Method Detail |
---|
public final SymbolCodec getCodec()
DataScheme
getCodec
in interface DataScheme
public final int getRecordCount()
DataScheme
getRecordCount
in interface DataScheme
public final DefaultRecord getRecord(int index)
DataScheme
getRecord
in interface DataScheme
public final DefaultRecord findRecordByName(java.lang.String name)
DataScheme
findRecordByName
in interface DataScheme
public final AbstractDataIntField findIntFieldByName(java.lang.String name)
DataScheme
findIntFieldByName
in interface DataScheme
public final AbstractDataObjField findObjFieldByName(java.lang.String name)
DataScheme
findObjFieldByName
in interface DataScheme
public <T> T getService(java.lang.Class<T> service_class)
DataScheme
null
if no scheme-specific override for the corresponding service is found.
Default implementation in DefaultScheme
is to use
Services.createService(java.lang.Class
with this scheme's class loader.
getService
in interface DataScheme
public static void setParentReferences(DataScheme scheme)
DefaultScheme(SymbolCodec, DataRecord[])
constructor now does it automatically.
DefaultScheme
.
java.lang.ClassCastException
- if scheme is not an instance of DefaultScheme
.
java.lang.IllegalStateException
- if some parent reference already set to different instance.public static void verifyScheme(DataScheme scheme)
DefaultScheme(SymbolCodec, DataRecord[])
constructor does it all automatically.
public static DataScheme createFromProperties(java.util.Map properties, java.lang.String prefix)
myscheme.codec.class=com.devexperts.qd.kit.PentaCodec myscheme.10.id=1 myscheme.10.name=Fundamental myscheme.10.0.class=com.devexperts.qd.kit.CompactIntField myscheme.10.0.name=Fundamental.High myscheme.10.1.class=com.devexperts.qd.kit.CompactIntField myscheme.10.1.name=Fundamental.Low myscheme.22.id=6 myscheme.22.name=Quote&A myscheme.22.time=true myscheme.22.0.class=com.devexperts.qd.kit.CompactIntField myscheme.22.0.name=Quote&A.Bid.Price myscheme.22.1.class=com.devexperts.qd.kit.CompactIntField myscheme.22.1.name=Quote&A.Bid.SizeThe numbers in the property key define relative index of record (first number) and field within the record (second number). These numbers must be small non-negative numbers, but they need not be consecutive.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |