mauda.evaluation
Class TimeStampRecorder

java.lang.Object
  extended by mauda.evaluation.TimeStampRecorder
All Implemented Interfaces:
ExerciseUpdateListener

public class TimeStampRecorder
extends java.lang.Object
implements ExerciseUpdateListener

Records the time-stamps for each operation during recording to a jedas-animation.

Author:
Markus Krebs

Field Summary
static long timeExtend
           
 
Constructor Summary
TimeStampRecorder(Exercise exercise)
          Creates a TimeStampRecorder
 
Method Summary
 void calculateSeqTimeStamps()
          Calculates from the eventually out-of-order-time-stamps sequential time-stamps.
 void exerciseUpdate(ExerciseUpdateEvent e)
          Invoked when an Event occures
 OpTimeStamp getActOpTimeStamp()
          Gets the actual time-stamp.
 OpTimeStamp getEntry(int offset)
          Gets a specific entry in the time-stamp-recorder.
 OpTimeStamp getSeqEntry(int offset)
          Gets a specific entry in the sequential-time-stamps.
 java.util.Vector getSeqTimeStamps()
          Gets the by the TimeStampRecorder.calculateSeqTimeStamps calculated time-stamps.
 java.util.Vector getTimeStamps()
          Gets the real time-stamps corresponding to the animation.
 void load(java.util.Vector v)
          Converts a vector that contains the time-stamps readed from a xml-file, and converts it for the internal representation.
 void printSeqTimeStamps()
          Prints out the entries of the sequential time-stamps.
 java.util.Vector save()
          Converts the time-stamps in an appropriate format, that can be saved to an xml-file
 void setPlayerMode(boolean b)
          Sets the player-mode of the timestamp-recorder.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeExtend

public static final long timeExtend
See Also:
Constant Field Values
Constructor Detail

TimeStampRecorder

public TimeStampRecorder(Exercise exercise)
Creates a TimeStampRecorder

Parameters:
exercise - Exercise
Method Detail

setPlayerMode

public void setPlayerMode(boolean b)
Sets the player-mode of the timestamp-recorder. If player- is true, then were no entries made for time-stamps, whereas in non-player-mode, the time-stamps have to be recorded.

Parameters:
b - true for player-mode, false otherwise.

exerciseUpdate

public void exerciseUpdate(ExerciseUpdateEvent e)
Description copied from interface: ExerciseUpdateListener
Invoked when an Event occures

Specified by:
exerciseUpdate in interface ExerciseUpdateListener
Parameters:
e - The event

getEntry

public OpTimeStamp getEntry(int offset)
Gets a specific entry in the time-stamp-recorder.

Parameters:
offset - The position of the entry to be returned
Returns:
The time-stamp-object

getSeqEntry

public OpTimeStamp getSeqEntry(int offset)
Gets a specific entry in the sequential-time-stamps.

Parameters:
offset - The position of the entry to be returned
Returns:
The time-stamp-object
See Also:
calculateSeqTimeStamps()

getActOpTimeStamp

public OpTimeStamp getActOpTimeStamp()
Gets the actual time-stamp.

Returns:
The actual time-stamp-object

calculateSeqTimeStamps

public void calculateSeqTimeStamps()
Calculates from the eventually out-of-order-time-stamps sequential time-stamps. That means, that the out-of-order time-stamps are calculated in in-order-time-stamps in that way, that they were time-connected (no time-gaps). Additionally this method sets an eventually missing stop-time of the last operation.
This method should only called by EvalPlayer.

See Also:
getSeqTimeStamps()

getTimeStamps

public java.util.Vector getTimeStamps()
Gets the real time-stamps corresponding to the animation.

Returns:
time-stamps

getSeqTimeStamps

public java.util.Vector getSeqTimeStamps()
Gets the by the TimeStampRecorder.calculateSeqTimeStamps calculated time-stamps.

Returns:
time-stamps
See Also:
calculateSeqTimeStamps()

printSeqTimeStamps

public void printSeqTimeStamps()
Prints out the entries of the sequential time-stamps.


save

public java.util.Vector save()
Converts the time-stamps in an appropriate format, that can be saved to an xml-file

Returns:
A Vector representation of the time-stamps

load

public void load(java.util.Vector v)
Converts a vector that contains the time-stamps readed from a xml-file, and converts it for the internal representation.

Parameters:
v - The vector from the xml-file