zoukankan      html  css  js  c++  java
  • 程序猿的量化交易之路(18)--Cointrader之Event实体(6)

    转载需注明:

    事件,是Esper的重要概念。

    这里我们定义个事件类。它是Temporal实体的派生类。

    不过对Temporal简单的包装。其代码例如以下:


    package org.cryptocoinpartners.schema;
    
    import org.joda.time.Instant;
    
    import javax.persistence.MappedSuperclass;
    
    
    /**
     * Subclasses of Event may be posted to Context
     *
     * @author Tim Olson
     */
    //是一个基类,在数据库中不创建表格。

    @MappedSuperclass public abstract class Event extends Temporal { /** * If the Event's time has not been set when it is being published, it will be set to the current time of the * publishing Context */ public void publishedAt(Instant instant) { if( getTime() == null ) setTime(instant); } /** Most events should use this constructor to provide the time of the original happening, not the time of * object creation */ protected Event(Instant time) { super(time); } protected Event() {} }



  • 相关阅读:
    第04组 beta冲刺(1/4)
    2019 SDN上机第5次作业
    SDN课程阅读作业(2)
    第04组 Alpha事后诸葛亮
    C Primer 复习题
    C Primer 编程练习
    C语言I博客作业04
    C语言I博客作业03
    C语言I博客作业02
    Appium + java截图方法
  • 原文地址:https://www.cnblogs.com/mthoutai/p/7091195.html
Copyright © 2011-2022 走看看