EMMA Coverage Report (generated Sun Aug 17 11:20:34 PDT 2014)
[all classes][net.digitaltsunami.tmeter.record]

COVERAGE SUMMARY FOR SOURCE FILE [FileTimeRecorder.java]

nameclass, %method, %block, %line, %
FileTimeRecorder.java100% (2/2)100% (5/5)96%  (53/55)99%  (12.9/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FileTimeRecorder$1100% (1/1)100% (1/1)89%  (17/19)89%  (0.9/1)
<static initializer> 100% (1/1)89%  (17/19)89%  (0.9/1)
     
class FileTimeRecorder100% (1/1)100% (4/4)100% (36/36)100% (13/13)
FileTimeRecorder (PrintStream): void 100% (1/1)100% (5/5)100% (2/2)
FileTimeRecorder (PrintStream, TimerLogType): void 100% (1/1)100% (9/9)100% (4/4)
getLogType (): TimerLogType 100% (1/1)100% (3/3)100% (1/1)
record (Timer): void 100% (1/1)100% (19/19)100% (6/6)

1package net.digitaltsunami.tmeter.record;
2 
3import java.io.PrintStream;
4 
5import net.digitaltsunami.tmeter.Timer;
6import net.digitaltsunami.tmeter.TimerLogType;
7 
8/**
9 * Record all timers to the provided output stream.
10 * 
11 * @author dhagberg
12 * 
13 */
14public class FileTimeRecorder implements TimeRecorder {
15 
16    protected final PrintStream out;
17    protected final TimerLogType logType;
18 
19    /**
20     * Create a new FileTimeRecorder with the output stream to which all timers.
21     * @param out print stream for timers. 
22     */
23    public FileTimeRecorder(PrintStream out) {
24        this(out, TimerLogType.TEXT);
25    }
26 
27    /**
28     * Create a new FileTimeRecorder with the output stream to which all timers
29     * will be written and the format in which they will be written.
30     * 
31     * @param out print stream for timers. 
32     * @param logType format used to write timers to output stream.
33     */
34    public FileTimeRecorder(PrintStream out, TimerLogType logType) {
35        super();
36        this.out = out;
37        this.logType = logType;
38    }
39 
40    @Override
41    public void record(Timer timer) {
42        switch (logType) {
43        case TEXT:
44            out.println(timer.toString());
45            break;
46 
47        case CSV:
48            out.println(timer.toCsv());
49            break;
50 
51        default:
52            break;
53        }
54    }
55 
56    public TimerLogType getLogType() {
57        return this.logType;
58    }
59 
60}

[all classes][net.digitaltsunami.tmeter.record]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov