public class DefaultScheme extends Object implements DataScheme
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.| Modifier and Type | Field and Description |
|---|---|
protected SymbolCodec |
codec |
protected String |
digest |
protected com.devexperts.logging.Logging |
log |
protected DefaultRecord[] |
records |
| Constructor and Description |
|---|
DefaultScheme(SymbolCodec codec,
DataRecord... records) |
| Modifier and Type | Method and Description |
|---|---|
static String |
calculateDigest(DataScheme scheme) |
AbstractDataIntField |
findIntFieldByName(String name)
Returns Int-field by its
full name. |
AbstractDataObjField |
findObjFieldByName(String name)
Returns Obj-field by its
full name. |
DefaultRecord |
findRecordByName(String name)
Returns data record by its name.
|
SymbolCodec |
getCodec()
Returns symbol codec used in this scheme.
|
String |
getDigest()
Returns digest of the scheme.
|
DefaultRecord |
getRecord(int index)
Returns data record by its index within this scheme.
|
int |
getRecordCount()
Returns number of records in this scheme.
|
<T> T |
getService(Class<T> serviceClass)
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. |
String |
toString() |
static void |
verifyScheme(DataScheme scheme)
Deprecated.
No replacement. Just remove usages of this method.
DefaultScheme(SymbolCodec, DataRecord[]) constructor does it all automatically. |
protected final com.devexperts.logging.Logging log
protected final SymbolCodec codec
protected final DefaultRecord[] records
protected String digest
public DefaultScheme(SymbolCodec codec, DataRecord... records)
public final SymbolCodec getCodec()
DataSchemegetCodec in interface DataSchemepublic final int getRecordCount()
DataSchemegetRecordCount in interface DataSchemepublic final DefaultRecord getRecord(int index)
DataSchemegetRecord in interface DataSchemepublic final DefaultRecord findRecordByName(String name)
DataSchemefindRecordByName in interface DataSchemepublic final AbstractDataIntField findIntFieldByName(String name)
DataSchemefull name.
Returns null if no such fields exists.findIntFieldByName in interface DataSchemepublic final AbstractDataObjField findObjFieldByName(String name)
DataSchemefull name.
Returns null if no such fields exists.findObjFieldByName in interface DataSchemepublic <T> T getService(Class<T> serviceClass)
DataSchemenull if no scheme-specific override for the corresponding service is found.
Default implementation in DefaultScheme is to use
Services.createService(java.lang.Class<T>, java.lang.ClassLoader, java.lang.String) with this scheme's class loader.
getService in interface DataSchemepublic String getDigest()
DataScheme
Returns null by default.
getDigest in interface DataSchemepublic static void setParentReferences(DataScheme scheme)
DefaultScheme(SymbolCodec, DataRecord[]) constructor now does it automatically.DefaultScheme.ClassCastException - if scheme is not an instance of DefaultScheme.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 String calculateDigest(DataScheme scheme)
Copyright © 2002–2025 Devexperts LLC. All rights reserved.