Commit | Line | Data |
---|---|---|
72eda778 ASL |
1 | /*******************************************************************************\r |
2 | * Copyright (c) 2009, 2010 Ericsson\r | |
3 | * \r | |
4 | * All rights reserved. This program and the accompanying materials are\r | |
5 | * made available under the terms of the Eclipse Public License v1.0 which\r | |
6 | * accompanies this distribution, and is available at\r | |
7 | * http://www.eclipse.org/legal/epl-v10.html\r | |
8 | * \r | |
9 | * Contributors:\r | |
10 | * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation\r | |
11 | *******************************************************************************/\r | |
f6281059 ASL |
12 | package org.eclipse.linuxtools.tmf.ui.widgets.timeAnalysis.test.stub.model;\r |
13 | \r | |
ce62370f | 14 | import java.util.Iterator;\r |
f6281059 ASL |
15 | import java.util.Vector;\r |
16 | \r | |
2fa130b8 PT |
17 | import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;\r |
18 | import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITmfTimeAnalysisEntry;\r | |
f6281059 | 19 | \r |
3b38ea61 | 20 | @SuppressWarnings("nls")\r |
f6281059 | 21 | public class TraceImpl implements ITmfTimeAnalysisEntry {\r |
72eda778 ASL |
22 | // ========================================================================\r |
23 | // Data\r | |
24 | // ========================================================================\r | |
f6281059 ASL |
25 | private int id = 0;\r |
26 | private String name = "traceDefaultName";\r | |
27 | private long startTime = 0;\r | |
28 | private long stopTime = 1;\r | |
29 | private String groupName = "defaultGroupName";\r | |
30 | private String className = "defaultClassName";\r | |
ce62370f | 31 | private Vector<ITimeEvent> traceEvents = new Vector<ITimeEvent>();\r |
72eda778 ASL |
32 | \r |
33 | // ========================================================================\r | |
34 | // Constructor\r | |
35 | // ========================================================================\r | |
f6281059 ASL |
36 | \r |
37 | public TraceImpl(int id, String name, long sTime, long stopTime,\r | |
38 | String groupName, String className) {\r | |
39 | this.id = id;\r | |
40 | this.name = name;\r | |
41 | this.startTime = sTime;\r | |
42 | this.stopTime = stopTime;\r | |
43 | this.groupName = groupName;\r | |
44 | this.className = className;\r | |
45 | }\r | |
46 | \r | |
72eda778 ASL |
47 | // ========================================================================\r |
48 | // Methods\r | |
49 | // ========================================================================\r | |
50 | \r | |
51 | public String getClassName() {\r | |
52 | return className;\r | |
53 | }\r | |
54 | \r | |
55 | public void setClassName(String className) {\r | |
56 | this.className = className;\r | |
57 | }\r | |
58 | \r | |
f6281059 ASL |
59 | public void setGroupName(String groupName) {\r |
60 | this.groupName = groupName;\r | |
61 | }\r | |
62 | \r | |
63 | public void setId(int id) {\r | |
64 | this.id = id;\r | |
65 | }\r | |
66 | \r | |
67 | public void setName(String name) {\r | |
68 | this.name = name;\r | |
69 | }\r | |
70 | \r | |
71 | public void setStartTime(long startTime) {\r | |
72 | this.startTime = startTime;\r | |
73 | }\r | |
74 | \r | |
75 | public void setStopTime(long stopTime) {\r | |
76 | this.stopTime = stopTime;\r | |
77 | }\r | |
78 | \r | |
d4011df2 | 79 | @Override\r |
f6281059 ASL |
80 | public String getGroupName() {\r |
81 | return groupName;\r | |
82 | }\r | |
83 | \r | |
d4011df2 | 84 | @Override\r |
f6281059 ASL |
85 | public int getId() {\r |
86 | return id;\r | |
87 | }\r | |
88 | \r | |
d4011df2 | 89 | @Override\r |
f6281059 ASL |
90 | public String getName() {\r |
91 | return name;\r | |
92 | }\r | |
93 | \r | |
d4011df2 | 94 | @Override\r |
f6281059 ASL |
95 | public long getStartTime() {\r |
96 | return startTime;\r | |
97 | }\r | |
98 | \r | |
d4011df2 | 99 | @Override\r |
f6281059 ASL |
100 | public long getStopTime() {\r |
101 | return stopTime;\r | |
102 | }\r | |
103 | \r | |
d4011df2 | 104 | @Override\r |
ce62370f | 105 | @Deprecated public Vector<ITimeEvent> getTraceEvents() {\r |
f6281059 ASL |
106 | return traceEvents;\r |
107 | }\r | |
ce62370f FC |
108 | \r |
109 | @Override\r | |
110 | public Iterator<ITimeEvent> getTraceEventsIterator() {\r | |
111 | return traceEvents.iterator();\r | |
112 | }\r | |
113 | \r | |
114 | @Override\r | |
115 | public Iterator<ITimeEvent> getTraceEventsIterator(long startTime, long stopTime, long maxDuration) {\r | |
116 | return traceEvents.iterator();\r | |
117 | }\r | |
118 | \r | |
119 | @Override\r | |
120 | public void addTraceEvent(ITimeEvent event) {\r | |
121 | traceEvents.add(event);\r | |
122 | }\r | |
f6281059 ASL |
123 | \r |
124 | }\r |