ctf: Handle traces with unknown event attributes
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui.tests / widgetStubs / org / eclipse / linuxtools / tmf / ui / widgets / timegraph / test / stub / model / EventImpl.java
CommitLineData
72eda778
ASL
1/*******************************************************************************\r
2 * Copyright (c) 2009, 2010 Ericsson\r
64636df8 3 *\r
72eda778
ASL
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
64636df8 8 *\r
72eda778
ASL
9 * Contributors:\r
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation\r
11 *******************************************************************************/\r
fb5cad3d 12package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.test.stub.model;\r
f6281059 13\r
fb5cad3d
PT
14import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;\r
15import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;\r
f6281059 16\r
64636df8
BH
17/**\r
18 * ITimeEvent implementation for test purposes.\r
19 */\r
20@SuppressWarnings("javadoc")\r
fb5cad3d 21public class EventImpl implements ITimeEvent {\r
72eda778
ASL
22 // ========================================================================\r
23 // Data\r
24 // ========================================================================\r
f6281059
ASL
25 public static enum Type {ERROR, WARNING, TIMEADJUSTMENT, ALARM, EVENT, INFORMATION, UNKNOWN, INFO1, INFO2, INFO3, INFO4, INFO5, INFO6, INFO7, INFO8, INFO9}\r
26\r
27 private long time = 0;\r
fb5cad3d 28 private ITimeGraphEntry trace = null;\r
64636df8
BH
29 private Type myType = Type.UNKNOWN;\r
30 private long duration;\r
31\r
72eda778
ASL
32 // ========================================================================\r
33 // Constructor\r
34 // ========================================================================\r
fb5cad3d 35 public EventImpl(long time, ITimeGraphEntry trace, Type type) {\r
f6281059
ASL
36 this.time = time;\r
37 this.trace = trace;\r
38 this.myType = type;\r
f6281059 39 }\r
64636df8 40\r
72eda778
ASL
41 // ========================================================================\r
42 // Methods\r
43 // ========================================================================\r
f6281059
ASL
44 public Type getType() {\r
45 return myType;\r
46 }\r
47\r
48 public void setType(Type myType) {\r
49 this.myType = myType;\r
50 }\r
51\r
52 public void setTime(long time) {\r
53 this.time = time;\r
54 }\r
55\r
fb5cad3d 56 public void setTrace(ITimeGraphEntry trace) {\r
f6281059
ASL
57 this.trace = trace;\r
58 }\r
64636df8 59\r
f6281059
ASL
60 @Override\r
61 public long getTime() {\r
62 return time;\r
63 }\r
64\r
65 @Override\r
fb5cad3d 66 public ITimeGraphEntry getEntry() {\r
f6281059
ASL
67 return trace;\r
68 }\r
69\r
70 /**\r
71 * @param duration the duration to set\r
72 */\r
73 public void setDuration(long duration) {\r
74 this.duration = duration;\r
75 }\r
76\r
77 /**\r
78 * @return the duration\r
79 */\r
8f50c396 80 @Override\r
f6281059
ASL
81 public long getDuration() {\r
82 return duration;\r
83 }\r
84\r
85}\r
This page took 0.035156 seconds and 5 git commands to generate.