source: tmcsimulator-scriptbuilder/trunk/src/scriptbuilder/structures/events/CADEvent.java @ 76

Revision 76, 1.3 KB checked in by bmcguffin, 9 years ago (diff)

Added javadoc for several files.

Line 
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6package scriptbuilder.structures.events;
7
8import java.util.StringTokenizer;
9import scriptbuilder.structures.ELEMENT;
10import scriptbuilder.structures.I_XML_Writable;
11import scriptbuilder.structures.ScriptEvent;
12import scriptbuilder.structures.XMLWriter;
13
14/**
15 * Data model for a CAD incident event. CAD events have a string description of
16 * what is occurring at that time, and may or may not have sub-events.
17 *
18 * @author Bryan McGuffin
19 */
20public class CADEvent extends ScriptEvent implements I_XML_Writable
21{
22
23    /**
24     * Constructor.
25     */
26    public CADEvent()
27    {
28        super(ScriptEventType.CAD_EVENT);
29    }
30
31    /**
32     * True if this CAD event has sub-events.
33     */
34    public boolean hasSubEvents = false;
35
36    /**
37     * Description of this event.
38     */
39    public String detail = "";
40
41    @Override
42    public String toXML()
43    {
44        StringTokenizer tok = new StringTokenizer(detail, "\n");
45        String output = "";
46        while (tok.hasMoreTokens())
47        {
48            output += XMLWriter.simpleTag(tok.nextToken(), ELEMENT.DETAIL);
49        }
50        return output;
51    }
52}
Note: See TracBrowser for help on using the repository browser.