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 | |
14 | import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.ITmfTimeAnalysisEntry;\r | |
15 | import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.TimeEvent;\r | |
16 | \r | |
17 | public class EventImpl extends TimeEvent {\r | |
72eda778 ASL |
18 | // ========================================================================\r |
19 | // Data\r | |
20 | // ========================================================================\r | |
f6281059 ASL |
21 | public static enum Type {ERROR, WARNING, TIMEADJUSTMENT, ALARM, EVENT, INFORMATION, UNKNOWN, INFO1, INFO2, INFO3, INFO4, INFO5, INFO6, INFO7, INFO8, INFO9}\r |
22 | \r | |
23 | private long time = 0;\r | |
24 | private ITmfTimeAnalysisEntry trace = null;\r | |
25 | private Type myType = Type.UNKNOWN; \r | |
26 | private long duration; \r | |
27 | \r | |
72eda778 ASL |
28 | // ========================================================================\r |
29 | // Constructor\r | |
30 | // ========================================================================\r | |
f6281059 ASL |
31 | public EventImpl(long time, ITmfTimeAnalysisEntry trace, Type type) {\r |
32 | this.time = time;\r | |
33 | this.trace = trace;\r | |
34 | this.myType = type;\r | |
35 | this.setDuration(super.getDuration());\r | |
36 | }\r | |
37 | \r | |
72eda778 ASL |
38 | // ========================================================================\r |
39 | // Methods\r | |
40 | // ========================================================================\r | |
f6281059 ASL |
41 | public Type getType() {\r |
42 | return myType;\r | |
43 | }\r | |
44 | \r | |
45 | public void setType(Type myType) {\r | |
46 | this.myType = myType;\r | |
47 | }\r | |
48 | \r | |
49 | public void setTime(long time) {\r | |
50 | this.time = time;\r | |
51 | }\r | |
52 | \r | |
53 | public void setTrace(ITmfTimeAnalysisEntry trace) {\r | |
54 | this.trace = trace;\r | |
55 | }\r | |
56 | \r | |
57 | @Override\r | |
58 | public long getTime() {\r | |
59 | return time;\r | |
60 | }\r | |
61 | \r | |
62 | @Override\r | |
63 | public ITmfTimeAnalysisEntry getEntry() {\r | |
64 | return trace;\r | |
65 | }\r | |
66 | \r | |
67 | /**\r | |
68 | * @param duration the duration to set\r | |
69 | */\r | |
70 | public void setDuration(long duration) {\r | |
71 | this.duration = duration;\r | |
72 | }\r | |
73 | \r | |
74 | /**\r | |
75 | * @return the duration\r | |
76 | */\r | |
f6281059 ASL |
77 | public long getDuration() {\r |
78 | return duration;\r | |
79 | }\r | |
80 | \r | |
81 | }\r |