Commit | Line | Data |
---|---|---|
be222f56 | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2009, 2014 Ericsson |
be222f56 PT |
3 | * |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation | |
11 | *******************************************************************************/ | |
2bdf0193 | 12 | package org.eclipse.tracecompass.tmf.ui.widgets.timegraph.test.stub.model; |
be222f56 | 13 | |
2bdf0193 AM |
14 | import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent; |
15 | import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; | |
be222f56 PT |
16 | |
17 | /** | |
18 | * ITimeEvent implementation for test purposes. | |
19 | */ | |
20 | @SuppressWarnings("javadoc") | |
21 | public class EventImpl implements ITimeEvent { | |
d5efe032 AF |
22 | // ======================================================================== |
23 | // Data | |
24 | // ======================================================================== | |
25 | public static enum Type {ERROR, WARNING, TIMEADJUSTMENT, ALARM, EVENT, INFORMATION, UNKNOWN, INFO1, INFO2, INFO3, INFO4, INFO5, INFO6, INFO7, INFO8, INFO9} | |
be222f56 | 26 | |
d5efe032 AF |
27 | private long time = 0; |
28 | private ITimeGraphEntry trace = null; | |
29 | private Type myType = Type.UNKNOWN; | |
30 | private long duration; | |
be222f56 | 31 | |
d5efe032 AF |
32 | // ======================================================================== |
33 | // Constructor | |
34 | // ======================================================================== | |
35 | public EventImpl(long time, ITimeGraphEntry trace, Type type) { | |
36 | this.time = time; | |
37 | this.trace = trace; | |
38 | this.myType = type; | |
39 | } | |
be222f56 | 40 | |
d5efe032 AF |
41 | // ======================================================================== |
42 | // Methods | |
43 | // ======================================================================== | |
44 | public Type getType() { | |
45 | return myType; | |
46 | } | |
be222f56 | 47 | |
d5efe032 AF |
48 | public void setType(Type myType) { |
49 | this.myType = myType; | |
50 | } | |
be222f56 | 51 | |
d5efe032 AF |
52 | public void setTime(long time) { |
53 | this.time = time; | |
54 | } | |
be222f56 | 55 | |
d5efe032 AF |
56 | public void setTrace(ITimeGraphEntry trace) { |
57 | this.trace = trace; | |
58 | } | |
be222f56 | 59 | |
d5efe032 AF |
60 | @Override |
61 | public long getTime() { | |
62 | return time; | |
63 | } | |
be222f56 | 64 | |
d5efe032 AF |
65 | @Override |
66 | public ITimeGraphEntry getEntry() { | |
67 | return trace; | |
68 | } | |
be222f56 | 69 | |
d5efe032 AF |
70 | /** |
71 | * @param duration the duration to set | |
72 | */ | |
73 | public void setDuration(long duration) { | |
74 | this.duration = duration; | |
75 | } | |
be222f56 | 76 | |
d5efe032 AF |
77 | /** |
78 | * @return the duration | |
79 | */ | |
80 | @Override | |
81 | public long getDuration() { | |
82 | return duration; | |
83 | } | |
be222f56 | 84 | |
2e7d9caa AM |
85 | @Override |
86 | public ITimeEvent splitBefore(long splitTime) { | |
87 | throw new UnsupportedOperationException(); | |
88 | } | |
89 | ||
90 | @Override | |
91 | public ITimeEvent splitAfter(long splitTime) { | |
92 | throw new UnsupportedOperationException(); | |
93 | } | |
94 | ||
be222f56 | 95 | } |