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