~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.tmf.ui.tests/widgetStubs/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/test/stub/model/EventImpl.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-05-13 21:43:22 UTC
  • mfrom: (1.2.1) (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130513214322-6frgd9du1n0w2uo7
Tags: 1.2.1-1
* Team upload.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.timegraph.test.stub.model;
13
 
 
14
 
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
15
 
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
16
 
 
17
 
public class EventImpl implements ITimeEvent {
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 ITimeGraphEntry trace = null;
25
 
        private Type myType = Type.UNKNOWN; 
26
 
        private long duration; 
27
 
        
28
 
        // ========================================================================
29
 
        // Constructor
30
 
        // ========================================================================
31
 
        public EventImpl(long time, ITimeGraphEntry trace, Type type) {
32
 
                this.time = time;
33
 
                this.trace = trace;
34
 
                this.myType = type;
35
 
        }
36
 
        
37
 
        // ========================================================================
38
 
        // Methods
39
 
        // ========================================================================
40
 
        public Type getType() {
41
 
                return myType;
42
 
        }
43
 
 
44
 
        public void setType(Type myType) {
45
 
                this.myType = myType;
46
 
        }
47
 
 
48
 
        public void setTime(long time) {
49
 
                this.time = time;
50
 
        }
51
 
 
52
 
        public void setTrace(ITimeGraphEntry trace) {
53
 
                this.trace = trace;
54
 
        }
55
 
        
56
 
        @Override
57
 
        public long getTime() {
58
 
                return time;
59
 
        }
60
 
 
61
 
        @Override
62
 
        public ITimeGraphEntry getEntry() {
63
 
                return trace;
64
 
        }
65
 
 
66
 
        /**
67
 
         * @param duration the duration to set
68
 
         */
69
 
        public void setDuration(long duration) {
70
 
                this.duration = duration;
71
 
        }
72
 
 
73
 
        /**
74
 
         * @return the duration
75
 
         */
76
 
        @Override
77
 
        public long getDuration() {
78
 
                return duration;
79
 
        }
80
 
 
81
 
}
 
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.timegraph.test.stub.model;
 
13
 
 
14
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
 
15
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
 
16
 
 
17
/**
 
18
 * ITimeEvent implementation for test purposes.
 
19
 */
 
20
@SuppressWarnings("javadoc")
 
21
public class EventImpl implements ITimeEvent {
 
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}
 
26
 
 
27
        private long time = 0;
 
28
        private ITimeGraphEntry trace = null;
 
29
        private Type myType = Type.UNKNOWN;
 
30
        private long duration;
 
31
 
 
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
        }
 
40
 
 
41
        // ========================================================================
 
42
        // Methods
 
43
        // ========================================================================
 
44
        public Type getType() {
 
45
                return myType;
 
46
        }
 
47
 
 
48
        public void setType(Type myType) {
 
49
                this.myType = myType;
 
50
        }
 
51
 
 
52
        public void setTime(long time) {
 
53
                this.time = time;
 
54
        }
 
55
 
 
56
        public void setTrace(ITimeGraphEntry trace) {
 
57
                this.trace = trace;
 
58
        }
 
59
 
 
60
        @Override
 
61
        public long getTime() {
 
62
                return time;
 
63
        }
 
64
 
 
65
        @Override
 
66
        public ITimeGraphEntry getEntry() {
 
67
                return trace;
 
68
        }
 
69
 
 
70
        /**
 
71
         * @param duration the duration to set
 
72
         */
 
73
        public void setDuration(long duration) {
 
74
                this.duration = duration;
 
75
        }
 
76
 
 
77
        /**
 
78
         * @return the duration
 
79
         */
 
80
        @Override
 
81
        public long getDuration() {
 
82
                return duration;
 
83
        }
 
84
 
 
85
}