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