Convert Windows line delimiters to Unix.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui.tests / widgetStubs / org / eclipse / linuxtools / tmf / ui / widgets / timegraph / test / stub / model / TraceImpl.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.timegraph.test.stub.model;
13
14 import java.util.Iterator;
15 import java.util.Vector;
16
17 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
18 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
19
20 @SuppressWarnings({"javadoc", "nls"})
21 public class TraceImpl implements ITimeGraphEntry {
22 // ========================================================================
23 // Data
24 // ========================================================================
25 private String name = "traceDefaultName";
26 private long startTime = 0;
27 private long stopTime = 1;
28 private String className = "defaultClassName";
29 private Vector<ITimeEvent> traceEvents = new Vector<ITimeEvent>();
30
31 // ========================================================================
32 // Constructor
33 // ========================================================================
34
35 public TraceImpl(String name, long sTime, long stopTime, String className) {
36 this.name = name;
37 this.startTime = sTime;
38 this.stopTime = stopTime;
39 this.className = className;
40 }
41
42 // ========================================================================
43 // Methods
44 // ========================================================================
45
46 public String getClassName() {
47 return className;
48 }
49
50 public void setClassName(String className) {
51 this.className = className;
52 }
53
54 public void setName(String name) {
55 this.name = name;
56 }
57
58 public void setStartTime(long startTime) {
59 this.startTime = startTime;
60 }
61
62 public void setStopTime(long stopTime) {
63 this.stopTime = stopTime;
64 }
65
66 @Override
67 public String getName() {
68 return name;
69 }
70
71 @Override
72 public long getStartTime() {
73 return startTime;
74 }
75
76 @Override
77 public long getEndTime() {
78 return stopTime;
79 }
80
81 @Override
82 public boolean hasTimeEvents() {
83 return traceEvents != null;
84 }
85
86 @Override
87 public Iterator<ITimeEvent> getTimeEventsIterator() {
88 return traceEvents.iterator();
89 }
90
91 @Override
92 public Iterator<ITimeEvent> getTimeEventsIterator(long aStartTime, long aStopTime, long maxDuration) {
93 return traceEvents.iterator();
94 }
95
96 public void addTraceEvent(ITimeEvent event) {
97 traceEvents.add(event);
98 }
99
100 @Override
101 public ITimeGraphEntry[] getChildren() {
102 return null;
103 }
104
105 @Override
106 public ITimeGraphEntry getParent() {
107 return null;
108 }
109
110 @Override
111 public boolean hasChildren() {
112 return false;
113 }
114
115 }
This page took 0.034347 seconds and 5 git commands to generate.