Changeset 76 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures


Ignore:
Timestamp:
08/25/2017 12:22:28 PM (9 years ago)
Author:
bmcguffin
Message:

Added javadoc for several files.

Location:
trunk/src/scriptbuilder/structures
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/I_XML_Writable.java

    r46 r76  
    1  
    21package scriptbuilder.structures; 
    32 
     
    87public interface I_XML_Writable 
    98{ 
     9 
     10    /** 
     11     * Translate this object's data into an appropriate XML string. 
     12     * 
     13     * @return an XML-compliant string representing this object's data 
     14     */ 
    1015    String toXML(); 
    1116} 
  • trunk/src/scriptbuilder/structures/MyScriptHandler.java

    r45 r76  
    241241    /** 
    242242     * Constructor. Initializes incident map. 
    243      */ 
    244     public MyScriptHandler(SimulationScript s) 
    245     { 
    246         script = s; 
     243     * 
     244     * @param scr the script into which the XML file is being read 
     245     */ 
     246    public MyScriptHandler(SimulationScript scr) 
     247    { 
     248        script = scr; 
    247249        incidentMap = new TreeMap<Integer, ScriptIncident>(); 
    248250        eventMap = new TreeMap<ELEMENT, I_ScriptEvent>(); 
     
    255257     * Get the list of incidents that have been parsed from the script file. 
    256258     * 
    257      * @returns Vector of Incident objects. 
     259     * @return Vector of Incident objects. 
    258260     */ 
    259261    public Vector<ScriptIncident> getIncidents() 
     
    265267     * Get the list of units that have been parsed from the script file. 
    266268     * 
    267      * @returns Vector of Unit objects. 
     269     * @return Vector of Unit objects. 
    268270     */ 
    269271    public ArrayList<Unit> getUnits() 
  • trunk/src/scriptbuilder/structures/ScriptEvent.java

    r72 r76  
    1818     * Compare the Script Events based on their type enum. 
    1919     * 
    20      * @param o the other script event to be compared 
     20     * @param a the other script event to be compared 
    2121     * @return -1, 0, or 1 depending on if this event's type comes before, 
    2222     * simultaneously, or after the other event's type in the enum list 
     
    130130    } 
    131131 
     132    /** 
     133     * Generate a new script event object of the specified type. 
     134     * 
     135     * @param t the type of the script event 
     136     * @return a new I_ScriptEvent object matching the given type 
     137     */ 
    132138    public static I_ScriptEvent factoryByType(ScriptEventType t) 
    133139    { 
     
    172178        } 
    173179    } 
    174      
     180 
     181    /** 
     182     * Determines if the event in question is an evaluation event. 
     183     * 
     184     * @param event the event to be checked 
     185     * @return true if the event implements I_EvaluationEvent 
     186     */ 
    175187    public static boolean isEvaluationEvent(I_ScriptEvent event) 
    176188    { 
  • trunk/src/scriptbuilder/structures/ScriptIncident.java

    r58 r76  
    221221    } 
    222222 
     223    /** 
     224     * Write this incident, in proper XML form, to the file in question. 
     225     * 
     226     * @param f the destination savefile 
     227     */ 
    223228    public void saveIncidentToFile(File f) 
    224229    { 
     
    298303    { 
    299304 
     305        /** 
     306         * The slice which has received focus in this event. 
     307         */ 
    300308        public TimeSlice slice; 
    301309 
     
    325333    { 
    326334 
     335        /** 
     336         * The incident which has received focus in this event. 
     337         */ 
    327338        public ScriptIncident incident; 
    328339 
  • trunk/src/scriptbuilder/structures/SimulationScript.java

    r65 r76  
    5050    }; 
    5151 
     52    /** 
     53     * The file to which this script will be saved. 
     54     */ 
    5255    public File saveFile = null; 
    5356 
     57    /** 
     58     * The name of this script. 
     59     */ 
    5460    public String title = ""; 
    5561 
     
    160166    } 
    161167 
     168    /** 
     169     * Add a new incident to the script. 
     170     * 
     171     * @param sci the incident to be added. 
     172     * @return true if there was enough room to add this incident. 
     173     */ 
    162174    public boolean addIncident(ScriptIncident sci) 
    163175    { 
     
    170182    } 
    171183 
     184    /** 
     185     * Write this script, in proper XML format, to the file in question. 
     186     * 
     187     * @param f the destination savefile to be written. 
     188     */ 
    172189    public void saveScriptToFile(File f) 
    173190    { 
     
    262279    } 
    263280 
     281    /** 
     282     * Counts the number of incidents currently running. 
     283     * 
     284     * @return the number of non-null incidents currently in the script. A 
     285     * number between 0 and INCIDENT_FILL_COUNT, inclusive. 
     286     */ 
    264287    public int incidentCount() 
    265288    { 
  • trunk/src/scriptbuilder/structures/TimeSlice.java

    r67 r76  
    4242     * @param seconds Number of seconds from the beginning of the simulation 
    4343     * that this timeslice occurs 
     44     * @param inc the incident to which this timeslice belongs. 
    4445     */ 
    4546    public TimeSlice(int seconds, ScriptIncident inc) 
  • trunk/src/scriptbuilder/structures/XMLWriter.java

    r46 r76  
    88{ 
    99 
     10    /** 
     11     * XML-style opening tag. Example: if given string "my_tag", returns 
     12     * "<my_tag>". 
     13     * 
     14     * @param s the XML element to be included in the tag. 
     15     * @return the properly formatted tag 
     16     */ 
    1017    public static String openTag(String s) 
    1118    { 
     
    1320    } 
    1421 
     22    /** 
     23     * XML-style closing tag. Example: if given string "my_tag", returns 
     24     * "</my_tag>". 
     25     * 
     26     * @param s the XML element to be included in the tag. 
     27     * @return the properly formatted tag 
     28     */ 
    1529    public static String closeTag(String s) 
    1630    { 
     
    1832    } 
    1933 
     34    /** 
     35     * XML-style empty tag. Example: if given string "my_tag", returns 
     36     * "<my_tag/>". 
     37     * 
     38     * @param s the XML element to be included in the tag. 
     39     * @return the properly formatted tag 
     40     */ 
    2041    public static String emptyTag(String s) 
    2142    { 
     
    2344    } 
    2445 
     46    /** 
     47     * Creates a pair of XML open and close tags to wrap a simple line of data. 
     48     * Useful if only one element need be enclosed in this particular tag. 
     49     * 
     50     * @param s the data to be wrapped 
     51     * @param e the XML element represented by the data 
     52     * @return an XML string of the format <my_tag>some_data_goes_here</my_tag> 
     53     */ 
    2554    public static String simpleTag(String s, ELEMENT e) 
    2655    { 
  • trunk/src/scriptbuilder/structures/events/ATMSEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public ATMSEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/ActivityLogEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public ActivityLogEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/AudioEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public AudioEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * Length of the audio to be played, in seconds. 
     32     */ 
    2733    public Integer audioLength = 0; 
    2834 
     35    /** 
     36     * File path for the audio file. 
     37     */ 
    2938    public String audioPath = ""; 
    3039 
  • trunk/src/scriptbuilder/structures/events/CADEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public CADEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/CADEvent.java

    r47 r76  
    2121{ 
    2222 
     23    /** 
     24     * Constructor. 
     25     */ 
    2326    public CADEvent() 
    2427    { 
     
    2629    } 
    2730 
     31    /** 
     32     * True if this CAD event has sub-events. 
     33     */ 
    2834    public boolean hasSubEvents = false; 
    2935 
     36    /** 
     37     * Description of this event. 
     38     */ 
    3039    public String detail = ""; 
    3140 
  • trunk/src/scriptbuilder/structures/events/CCTVEvent.java

    r46 r76  
    1212 
    1313/** 
    14  * Data model for a CCTV event. (Just a stub; CCTV events aren't currently 
    15  * used.) A CCTV event has, for now, a string message. 
     14 * Data model for a CCTV event(Just a stub; CCTV events aren't currently 
     15 * used). A CCTV event has, for now, a string message. 
    1616 * 
    1717 * @author Bryan McGuffin 
     
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public CCTVEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * The message represented by this event. 
     32     */ 
    2733    public String message = ""; 
    2834 
  • trunk/src/scriptbuilder/structures/events/CHPRadioEvent.java

    r46 r76  
    2222{ 
    2323 
     24    /** 
     25     * Constructor. 
     26     */ 
    2427    public CHPRadioEvent() 
    2528    { 
     
    2730    } 
    2831 
     32    /** 
     33     * List of the lines of dialog in this event. 
     34     */ 
    2935    public ArrayList<String> lines = new ArrayList<String>(); 
    3036 
     37    /** 
     38     * List of the corresponding roles for each line of dialog. 
     39     */ 
    3140    public ArrayList<String> roles = new ArrayList<String>(); 
    3241 
     42    /** 
     43     * Path for the audio file to be played during this event. 
     44     */ 
    3345    public String radioFile = ""; 
    3446 
  • trunk/src/scriptbuilder/structures/events/CMSEvaluationEvent.java

    r46 r76  
    2121{ 
    2222 
     23    /** 
     24     * Constructor. 
     25     */ 
    2326    public CMSEvaluationEvent() 
    2427    { 
  • trunk/src/scriptbuilder/structures/events/FacilitatorEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public FacilitatorEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/MaintenanceRadioEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public MaintenanceRadioEvent() 
    2326    { 
  • trunk/src/scriptbuilder/structures/events/ParamicsEvent.java

    r47 r76  
    2121{ 
    2222 
     23    /** 
     24     * Constructor. 
     25     */ 
    2326    public ParamicsEvent() 
    2427    { 
  • trunk/src/scriptbuilder/structures/events/RadioEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public RadioEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/TMTRadioEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public TMTRadioEvent() 
    2326    { 
  • trunk/src/scriptbuilder/structures/events/TelephoneEvent.java

    r46 r76  
    2222{ 
    2323 
     24    /** 
     25     * Constructor. 
     26     */ 
    2427    public TelephoneEvent() 
    2528    { 
  • trunk/src/scriptbuilder/structures/events/TowEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public TowEvent() 
    2326    { 
  • trunk/src/scriptbuilder/structures/events/UnitEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public UnitEvent() 
    2326    { 
Note: See TracChangeset for help on using the changeset viewer.