AioTrade Investigation (Section B: DataContract and Content)
guibin.beijing@gmail.com
AioTrade source code:
https://github.com/dcaoyuan/aiotrade
The DataContract's source code is located at
https://github.com/dcaoyuan/aiotrade/blob/master/libs/lib.math/src/main/scala/org/aiotrade/lib/math/timeseries/datasource/DataContract.scala. In order to understand the concept of DataContract, lets review the concept of DataObject in NetBeans firstly.
DataObjects wrap FileObjects. A FileObject is just a container for data; it happens to have a MIME type, but like java.io.File, it doesn't know or care what kind of file it represents, or what data it contains.
A DataObject represents one or more (typically only one) FileObjects. A DataObject knows what kind of a file it represents. It may represent the parsed contents of a file such as a .java file. Or, as in the case of InstanceDataObject, the file name may have semantic meaning. Reference about DataObject:
http://wiki.netbeans.org/DevFaqDataObject.
Then we talk a little bit about Descriptor(org.aiotrade.lib.math.timeseries.descriptor.Descriptor), its source code can be found at
https://github.com/dcaoyuan/aiotrade/blob/master/libs/lib.math/src/main/scala/org/aiotrade/lib/math/timeseries/descriptor/Descriptor.scala. Descriptor is something like NetBeans' DataObject, it is just a container for service instance, which can be used method
createServiceInstance(args: Any*) to create or lookup one. Descriptor has the information about service class name, frequent, isActive. It use the service class name to create the service instance, and the isActive is to mark whether the Descriptor is active. The frequent is an attribute of the Descritor, the frequently-used value can be ONE_SEC, ONE_MIN, ONE_HOUR, DAILY, WEEKLY, MONTHLY, ONE_YEAR. Details about TFreq please refer to org.aiotrade.lib.math.timeseries.TFreq.
Let's go back to talk about DataContract. The DataContract simply inherits the Descriptor. It is assumed that the binding class(that is service class) provides the data service for the DataContract.
Finally, we have to say something about Content(org.aiotrade.lib.math.timeseries.descriptor.Content), its source code is at
https://github.com/dcaoyuan/aiotrade/blob/master/libs/lib.math/src/main/scala/org/aiotrade/lib/math/timeseries/descriptor/Content.scala.
Content is actually a container for descriptors. It provides convient method to add, remove, indexOf, clear, lookup the descriptors which are saved in this Content.
The Content provides a relationship between the DataServer(the data source service via DataContract's service class) and the Indicator(the descriptor which is added into the Content) which can be computed via the data originated from the data server.
So, when initializing the Sec(org.aiotrade.lib.securities.model.Sec), firstly get the Content form the sec.content, then add the TickerContract, QuoteContract, MoneyFlowContract to the content use content.addDescriptor, finally add the Indicators' descirptor to the content.
分享到:
相关推荐
《电泳沉积法制备SnO2:Ti复合纳米线阵列及其气敏性质研究》 本文由李建军、朱金波等学者共同发表,详细探讨了利用电泳沉积法制备SnO2:Ti复合纳米线阵列的过程及其在气体传感方面的优异性能。该研究首次报道了这种...
comparative investigation between a single ended and a balanced IF VGA
高速偏振移位键控: 实验与数值研究,李政勇,王志豪,详细研究一种由两个正交偏振态来实现的偏振移位键控(PolSK)方案,分别进行了10 Gb/s传输实验和40 Gb/s数值模拟。使用常见的马赫 - 曾��
Investigation of Solid Waste Management and its environmental problem in El,John Leju Celestino Ladu,Marcelino Tombe Jada,This study attempts to investigate the management of solid wastes and ...
《Vision:A Computational Investigation into the Human Representation and Processing of Visual Information》,计算机视觉奠基之作
Investigation of Layered Bismuthates: (Ba, K)3Bi2O7 and (Ba, K)2BiO4 Schichtförmige Manganate Poster Investigation of Layered Bismuthates: (Ba,K)3Bi2O7 and (Ba,K)2BiO4 N. R. Khasanovaa, M. L. ...
Cu-Cr-W和Cu-Cr-Mo三元合金相平衡的实验研究及热力学计算,王翠萍,黄德笑,本文通过EMPA、XRD、DSC等实验方法测定Cu-Cr-W和Cu-Cr-Mo的相平衡。同时基于本次研究得到的实验结果,利用CALPHAD技术对Cu-Cr-W和Cu-Cr-Mo...
《TEMS Investigation 7.1中文说明书》是一个关键的资源,它详细介绍了Telecommunications Engineer's Mobile System (TEMS) Investigation工具的7.1版本。TEMS Investigation是移动网络测试和分析的重要工具,广泛...
在给定文件中,涉及到的知识点包括光谱学在生物化学领域的应用、芒果苷与牛血清白蛋白的相互作用机制研究以及β-环糊精对这个体系的影响。 首先,研究中的“光谱学”是通过各种光谱技术对物质的成分、分子结构以及...
iPhone and iOS Forensics Investigation, Analysis and Mobile Security for Apple iPhone, iPad and iOS Devices 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都...
在本文档TEMS Investigation 14.2 Release Note中,我们主要关注TEMS Investigation 14.2版本的新功能和特性,同时也会详细介绍一些具体的操作步骤和应用场景。 首先,TEMS Investigation 14.2版本新增了对Sharp ...
根据提供的信息,我们可以总结出以下关于“Ischemic Stroke-An Atlas of Investigation and Treatment.pdf”的相关知识点: ### 一、书籍基本信息 - **书名**:Ischemic Stroke-An Atlas of Investigation and ...
"Opti-scan Investigation 7.4.3.0" 是一款由欧佩泰斯(可能是指一家专注于光学扫描或检测技术的公司)开发的专业软件工具。这款软件主要用于光学扫描和调查,它提供了高级的图像处理和分析功能,旨在帮助用户在多个...
《TEMS Investigation 16 使用说明》文档详细介绍了如何安装和使用华为的TEMS Investigation 16软件,这是一款用于移动通信网络测试和分析的专业工具。文档特别强调了相较于旧版本15.3,16版修复了一系列重要的问题...
Polarization-shift keying (PolSK), which is performed based on two orthogonal polarization states, is investigated in detail by experimental and numerical simulation for data rates of 10 and 40 Gb/s....
在研究磁场作用下浆料粘度与内部结构关系的过程中,重要的是理解磁场如何影响铁磁性与非磁性颗粒组成的悬浮液,并进一步了解这种影响如何改变材料的流动特性。具体来说,涉及到的关键知识点包括: ...