EMMA Coverage Report (generated Tue May 01 18:46:53 CEST 2007)
[all classes][dk.deepthought.sidious.gui]

COVERAGE SUMMARY FOR SOURCE FILE [SidiousOutput.java]

nameclass, %method, %block, %line, %
SidiousOutput.java100% (1/1)83%  (5/6)57%  (28/49)52%  (7,8/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SidiousOutput100% (1/1)83%  (5/6)57%  (28/49)52%  (7,8/15)
register (SidiousController): void 0%   (0/1)0%   (0/5)0%   (0/2)
addFinishedPlan (Plan): void 100% (1/1)47%  (7/15)36%  (1,4/4)
addVertex (Vertex): void 100% (1/1)47%  (7/15)36%  (1,4/4)
<static initializer> 100% (1/1)100% (9/9)100% (2/2)
SidiousOutput (): void 100% (1/1)100% (3/3)100% (2/2)
getInstance (): SidiousOutput 100% (1/1)100% (2/2)100% (1/1)

1package dk.deepthought.sidious.gui;
2 
3import java.util.ArrayList;
4import java.util.List;
5 
6import dk.deepthought.sidious.planner.AStarAlgorithm;
7import dk.deepthought.sidious.planner.Plan;
8import dk.deepthought.sidious.planner.graph.Vertex;
9 
10/**
11 * Class works as a provider of messages from within the planner.
12 * 
13 * @author Deepthought
14 * 
15 */
16public class SidiousOutput {
17 
18        /**
19         * The singleton instance of this.
20         */
21        private static final SidiousOutput INSTANCE = new SidiousOutput();
22 
23        /**
24         * List of listeners.
25         */
26        private static List<SidiousController> listeners = new ArrayList<SidiousController>();
27 
28        /**
29         * Private constructor.
30         */
31        private SidiousOutput() {
32        }
33 
34        /**
35         * Gets the singleton instance of this.
36         * 
37         * @return the singleton instance.
38         */
39        public static SidiousOutput getInstance() {
40                return INSTANCE;
41        }
42 
43        /**
44         * Adds a vertex to this.
45         * <p>
46         * Is called from the jAStar method in the AStarAlgorithm class.
47         * 
48         * @see AStarAlgorithm
49         * @param vertex
50         */
51        public void addVertex(Vertex vertex) {
52                for (SidiousController controller : listeners) {
53                        controller.vertex(vertex);
54                }
55        }
56 
57        /**
58         * Registers the specified controller as listener of this.
59         * 
60         * @param controller
61         *            the controller to register
62         * 
63         */
64        public void register(SidiousController controller) {
65                listeners.add(controller);
66        }
67 
68        /**
69         * Adds a finished plan to this. All listeners are notified.
70         * 
71         * @param plan
72         *            the plan to add
73         */
74        public void addFinishedPlan(Plan plan) {
75                for (SidiousController controller : listeners) {
76                        controller.finished(plan);
77                }
78        }
79 
80}

[all classes][dk.deepthought.sidious.gui]
EMMA 2.0.5312 (C) Vladimir Roubtsov