source: tmcsimulator/trunk/src/tmcsim/client/cadclientgui/data/IncidentVehicle.java @ 3

Revision 3, 2.1 KB checked in by jdalbey, 10 years ago (diff)

Initial Import of project files - cadclientgui

Line 
1package tmcsim.client.cadclientgui.data;
2
3import java.io.Serializable;
4import java.util.LinkedList;
5
6import javax.swing.table.DefaultTableModel;
7
8/**
9 * NOTE THIS CLASS IS CURRENTLY UNUSED. This class is a
10 * further subdivision of Incident to hold data.
11 *
12 * @author Vincent
13 *
14 */
15public class IncidentVehicle implements Serializable {
16
17    private LinkedList<String> plate;
18    private LinkedList<String> state;
19    private LinkedList<String> type;
20    private LinkedList<String> year;
21    private DefaultTableModel licenseTable;
22
23    private static enum RESPONSE_ENUMS {
24        PLATE("PLATE"), STATE("STATE"), TYPE("TYPE"), YEAR("YEAR");
25
26        public String tag;
27
28        private RESPONSE_ENUMS(String t) {
29            tag = t;
30        }
31    }
32
33    /*
34     * Constructor. Initializes all objects to avoid null pointers.
35     */
36    public IncidentVehicle() {
37        plate = new LinkedList<String>();
38        state = new LinkedList<String>();
39        type = new LinkedList<String>();
40        year = new LinkedList<String>();
41        licenseTable = new DefaultTableModel();
42        licenseTable.setColumnIdentifiers(new String[] { "Plate", "State" });
43    }
44
45    public LinkedList<String> getPlate() {
46        return plate;
47    }
48
49    /*
50     * public void addPlate(String plate) { this.plate.add(plate); }
51     */
52
53    public LinkedList<String> getState() {
54        return state;
55    }
56
57    /*
58     * public void addState(String state) { this.state.add(state); }
59     */
60
61    public LinkedList<String> getType() {
62        return type;
63    }
64
65    /*
66     * public void addType(String type){ this.type.add(type); }
67     */
68
69    public LinkedList<String> getYear() {
70        return year;
71    }
72
73    /*
74     * public void addYear(String year){ this.year.add(year); }
75     */
76
77    public DefaultTableModel getLicenseTable() {
78        return licenseTable;
79    }
80
81    public void addVehicleInformation(String plate, String state, String type,
82            String year) {
83        this.plate.add(plate);
84        this.state.add(state);
85        this.type.add(type);
86        this.year.add(year);
87        licenseTable.addRow(new String[] { plate, state });
88    }
89
90}
Note: See TracBrowser for help on using the repository browser.