b5100c5a811771a58f35fa680e3434c7fde2372e
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / model / trange / TimeRangeComposite.java
1 /*******************************************************************************
2 * Copyright (c) 2009 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.lttng.ui.model.trange;
13
14 import java.util.Vector;
15
16 import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.ITmfTimeAnalysisEntry;
17
18 public class TimeRangeComposite extends TimeRangeComponent implements
19 ITmfTimeAnalysisEntry {
20
21 // ========================================================================
22 // Data
23 // =======================================================================
24 /**
25 * Type of Composites or Containers
26 * <p>
27 * PROPERTY: Refers to a sub-composite of a RESOURCE or a PROCESS e.g the
28 * cpu which can vary over time and can have time range events associated to
29 * it, and at the same time PROPERTY is associated to a Composite parent
30 * like a PROCESS
31 * </p>
32 * <p>
33 * PROCESS: A composite of time range events representing a Process
34 * </p>
35 * <p>
36 * RESOURCE: A composite of time range events representing a resource i.g.
37 * irq, softIrq, trap, bdev, cpu
38 * </p>
39 *
40 * @author alvaro
41 *
42 */
43 public static enum CompositeType {
44 UNKNOWN, PROPERTY, PROCESS, RESOURCE
45 }
46
47 protected final Vector<TimeRangeComponent> ChildEventLeafs = new Vector<TimeRangeComponent>();
48 protected final Vector<TimeRangeComponent> ChildEventComposites = new Vector<TimeRangeComponent>();
49 protected Integer id = 0;
50 protected String name;
51 protected String groupName = "";
52 protected String className = "";
53 protected CompositeType contType = CompositeType.UNKNOWN;
54
55 // ========================================================================
56 // Constructors
57 // =======================================================================
58 public TimeRangeComposite(Integer id, Long stime, Long etime, String name, CompositeType type) {
59 super(stime, etime, null);
60 this.id = id;
61 this.name = name;
62 contType = type;
63 }
64
65 public TimeRangeComposite(Integer id, Long stime, Long etime, String name, String groupName, String className, CompositeType type) {
66 this(id, stime, etime, name, type);
67
68 this.groupName = groupName;
69 this.className = className;
70
71 }
72
73 // ========================================================================
74 // Methods
75 // =======================================================================
76
77 /*
78 * (non-Javadoc)
79 *
80 * @see
81 * org.eclipse.linuxtools.lttng.ui.model.trange.TimeRangeComponent#getName()
82 */
83 @Override
84 public String getName() {
85 return name;
86 }
87
88 /**
89 * @param name
90 */
91 public void setName(String name) {
92 this.name = name;
93 }
94
95 /*
96 * (non-Javadoc)
97 *
98 * @seeorg.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.
99 * ITmfTimeAnalysisEntry#getGroupName()
100 */
101 public String getGroupName() {
102 return groupName;
103 }
104
105 /**
106 * @param groupName
107 */
108 public void setGroupName(String groupName) {
109 this.groupName = groupName;
110 }
111
112 /*
113 * (non-Javadoc)
114 *
115 * @seeorg.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.
116 * ITmfTimeAnalysisEntry#getId()
117 */
118 public int getId() {
119 return id;
120 }
121
122 /**
123 * @param id
124 */
125 public void setId(int id) {
126 this.id = id;
127 }
128
129 /**
130 * @return
131 */
132 public String getClassName() {
133 return className;
134 }
135
136 /**
137 * @param className
138 */
139 public void setClassName(String className) {
140 this.className = className;
141 }
142
143 /*
144 * (non-Javadoc)
145 *
146 * @seeorg.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.
147 * ITmfTimeAnalysisEntry#getTraceEvents()
148 */
149 @SuppressWarnings("unchecked")
150 public Vector<TimeRangeComponent> getTraceEvents() {
151 return ChildEventLeafs;
152 }
153
154 /**
155 * @return
156 */
157 public Vector<TimeRangeComponent> getChildEventComposites() {
158 return ChildEventComposites;
159 }
160
161 }
This page took 0.033767 seconds and 4 git commands to generate.