Ignore:
Timestamp:
11/16/12 13:51:11 (12 years ago)
Author:
pharms
Message:
  • added support for storing timestamps with events
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/Event.java

    r958 r996  
    2424 * <p> 
    2525 * Base class for all events. An event is described by its {@link #type} and its {@link #target}. 
     26 * An event may be provided with a timestamp and further parameters. 
    2627 * </p> 
    2728 *  
     
    6263 
    6364    /** 
    64      * </p> Target of the event. 
     65     * <p> 
     66     * Target of the event. 
     67     * </p> 
    6568     */ 
    6669    private IEventTarget target = null; 
     70     
     71    /** 
     72     * <p> 
     73     * Timestamp of when the event took place. 
     74     * </p> 
     75     */ 
     76    private long timestamp = Long.MIN_VALUE; 
    6777     
    6878    /** 
     
    114124    /** 
    115125     * <p> 
    116      * Two events are equal, if their {@link #type} and {@link #target} are equal. 
     126     * Two events are equal, if their {@link #type} and {@link #target} are equal. The timestamp 
     127     * and other parameters are ignored. 
    117128     * </p> 
    118129     * <p> 
     
    309320    /** 
    310321     * <p> 
     322     * Sets the timestamp of the event, i.e. when the event occurred. A timestamp for events is 
     323     * optional. Therefore it is also ignored by the {@link #equals(Object)}-method. A timestamp 
     324     * with a value smaller 0 means, that now timestamp for the event exists. 
     325     * </p> 
     326     *  
     327     * @param timestamp the new value for the timestamp 
     328     */ 
     329    public void setTimestamp(long timestamp) { 
     330        this.timestamp = timestamp; 
     331    } 
     332 
     333    /** 
     334     * <p> 
     335     * Returns the timestamp of the event or a value lower than 0 if no timestamp for the event 
     336     * exists. 
     337     * </p> 
     338     *  
     339     * @return the timestamp of the event or a value lower than 0 if no timestamp exists 
     340     */ 
     341    public long getTimestamp() { 
     342        return timestamp; 
     343    } 
     344 
     345    /** 
     346     * <p> 
    311347     * Returns a the list of replay events. 
    312348     * </p> 
Note: See TracChangeset for help on using the changeset viewer.