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