Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 74e0c9fad252eb51b20f97e9e47b7dac7ed5def3 (plain) (blame)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*******************************************************************************
 * 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 java.util.Iterator;
import java.util.Vector;

import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;

@SuppressWarnings({"javadoc", "nls"})
public class TraceImpl implements ITimeGraphEntry {
    // ========================================================================
    // Data
    // ========================================================================
    private String name = "traceDefaultName";
    private long startTime = 0;
    private long stopTime = 1;
    private String className = "defaultClassName";
    private Vector<ITimeEvent> traceEvents = new Vector<ITimeEvent>();

    // ========================================================================
    // Constructor
    // ========================================================================

    public TraceImpl(String name, long sTime, long stopTime, String className) {
        this.name = name;
        this.startTime = sTime;
        this.stopTime = stopTime;
        this.className = className;
    }

    // ========================================================================
    // Methods
    // ========================================================================

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public void setStopTime(long stopTime) {
        this.stopTime = stopTime;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public long getStartTime() {
        return startTime;
    }

    @Override
    public long getEndTime() {
        return stopTime;
    }

    @Override
    public boolean hasTimeEvents() {
        return traceEvents != null;
    }

    @Override
    public Iterator<ITimeEvent> getTimeEventsIterator() {
        return traceEvents.iterator();
    }

    @Override
    public Iterator<ITimeEvent> getTimeEventsIterator(long aStartTime, long aStopTime, long maxDuration) {
        return traceEvents.iterator();
    }

    public void addTraceEvent(ITimeEvent event) {
        traceEvents.add(event);
    }

    @Override
    public ITimeGraphEntry[] getChildren() {
        return null;
    }

    @Override
    public ITimeGraphEntry getParent() {
        return null;
    }

    @Override
    public boolean hasChildren() {
        return false;
    }

}

Back to the top