EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.bo.log]

COVERAGE SUMMARY FOR SOURCE FILE [DefaultModuleEventListener.java]

nameclass, %method, %block, %line, %
DefaultModuleEventListener.java100% (1/1)100% (6/6)100% (71/71)100% (14/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DefaultModuleEventListener100% (1/1)100% (6/6)100% (71/71)100% (14/14)
DefaultModuleEventListener (): void 100% (1/1)100% (4/4)100% (2/2)
DefaultModuleEventListener (PrintStream): void 100% (1/1)100% (9/9)100% (4/4)
addModule (QedeqBo): void 100% (1/1)100% (17/17)100% (2/2)
removeModule (QedeqBo): void 100% (1/1)100% (17/17)100% (2/2)
setPrintStream (PrintStream): void 100% (1/1)100% (4/4)100% (2/2)
stateChanged (QedeqBo): void 100% (1/1)100% (20/20)100% (2/2)

1/* This file is part of the project "Hilbert II" - http://www.qedeq.org
2 *
3 * Copyright 2000-2014,  Michael Meyling <mime@qedeq.org>.
4 *
5 * "Hilbert II" is free software; you can redistribute
6 * it and/or modify it under the terms of the GNU General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15 
16package org.qedeq.kernel.bo.log;
17 
18import java.io.PrintStream;
19 
20import org.qedeq.base.utility.DateUtility;
21import org.qedeq.kernel.bo.common.QedeqBo;
22 
23/**
24 * Listener that writes events to a stream.
25 *
26 * @author  Michael Meyling
27 */
28public class DefaultModuleEventListener implements ModuleEventListener {
29 
30    /** Stream for output. */
31    private PrintStream out = System.out;
32 
33    /**
34     * Constructor.
35     */
36    public DefaultModuleEventListener() {
37        this(System.out);
38    }
39 
40    /**
41     * Constructor.
42     *
43     * @param   stream  Print to this stream.
44     */
45    public DefaultModuleEventListener(final PrintStream stream) {
46        this.out = stream;
47    }
48 
49    /**
50     * Set output stream.
51     *
52     * @param   stream  Output stream.
53     */
54    public final void setPrintStream(final PrintStream stream) {
55        this.out = stream;
56    }
57 
58    public void addModule(final QedeqBo prop) {
59        out.println(DateUtility.getTimestamp() + " Module added."
60            + "\n\t" + prop.getUrl());
61    }
62 
63    public void stateChanged(final QedeqBo prop) {
64        out.println(DateUtility.getTimestamp() + " Module state changed. "
65            + prop.getStateDescription() + "\n\t" + prop.getUrl());
66    }
67 
68    public void removeModule(final QedeqBo prop) {
69        out.println(DateUtility.getTimestamp() + " Module removed."
70            + "\n\t" + prop.getUrl());
71    }
72 
73}

[all classes][org.qedeq.kernel.bo.log]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov