source: tmcsimulator/trunk/src/tmcsim/highwaymodel/trafficeventseditor/TimeFrame.java @ 541

Revision 541, 727 bytes checked in by jdalbey, 6 years ago (diff)

TrafficEventsEditor?: add comments

Line 
1package tmcsim.highwaymodel.trafficeventseditor;
2
3import java.util.ArrayList;
4import java.util.List;
5
6/**
7 * A list of TrafficLaneEvents
8 * @author jtorres
9 */
10public class TimeFrame
11{
12    final public String time;
13    public List<TrafficLaneEvent> events;
14   
15    public TimeFrame(String time)
16    {
17        this.time = time;
18        this.events = new ArrayList<>();
19    }
20   
21    public void addEvent(TrafficLaneEvent newEvent)
22    {
23        for(TrafficLaneEvent event : events)
24        {
25            if(event.equals(newEvent))
26            {
27                events.remove(event);
28            }
29        }
30        events.add(newEvent);
31    }
32   
33    @Override
34    public String toString()
35    {
36        return time;
37    }
38}
Note: See TracBrowser for help on using the repository browser.