1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
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
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.ui
.model
.trange
;
14 import java
.util
.Vector
;
16 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.timeAnalysis
.model
.ITmfTimeAnalysisEntry
;
18 public class TimeRangeComposite
extends TimeRangeComponent
implements
19 ITmfTimeAnalysisEntry
{
21 // ========================================================================
23 // =======================================================================
25 * Type of Composites or Containers
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
33 * PROCESS: A composite of time range events representing a Process
36 * RESOURCE: A composite of time range events representing a resource i.g.
37 * irq, softIrq, trap, bdev, cpu
43 public static enum CompositeType
{
44 UNKNOWN
, PROPERTY
, PROCESS
, RESOURCE
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 protected long next_good_time
= -1;
55 /*Time of first event which trigger the creation of this local resource */
56 protected long insertionTime
= -1;
58 // ========================================================================
60 // =======================================================================
61 public TimeRangeComposite(Integer id
, Long stime
, Long etime
, String name
,
62 CompositeType type
, long insertionTime
) {
63 super(stime
, etime
, null);
67 this.insertionTime
= insertionTime
;
68 // Adjust the first good drawing position to the event time creating this resource
69 next_good_time
= insertionTime
;
72 public TimeRangeComposite(Integer id
, Long stime
, Long etime
, String name
,
73 String groupName
, String className
, CompositeType type
,
75 this(id
, stime
, etime
, name
, type
, insertionTime
);
76 this.groupName
= groupName
;
77 this.className
= className
;
80 // ========================================================================
82 // =======================================================================
88 * org.eclipse.linuxtools.lttng.ui.model.trange.TimeRangeComponent#getName()
91 public String
getName() {
98 public void setName(String name
) {
105 * @seeorg.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.
106 * ITmfTimeAnalysisEntry#getGroupName()
108 public String
getGroupName() {
115 public void setGroupName(String groupName
) {
116 this.groupName
= groupName
;
122 * @seeorg.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.
123 * ITmfTimeAnalysisEntry#getId()
132 public void setId(int id
) {
139 public String
getClassName() {
146 public void setClassName(String className
) {
147 this.className
= className
;
153 * @seeorg.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.
154 * ITmfTimeAnalysisEntry#getTraceEvents()
156 @SuppressWarnings("unchecked")
157 public Vector
<TimeRangeComponent
> getTraceEvents() {
158 return ChildEventLeafs
;
164 public Vector
<TimeRangeComponent
> getChildEventComposites() {
165 return ChildEventComposites
;
169 * Represents the time where the next time range can start the drawing i.e.
170 * right after previous time range.
174 public long getNext_good_time() {
175 return next_good_time
;
179 * Represents the time where the next time range can start the drawing i.e.
180 * right after previous time range.
182 * @param nextGoodTime
184 public void setNext_good_time(long nextGoodTime
) {
185 next_good_time
= nextGoodTime
;
189 * Reset this resource to the construction state
191 public void reset() {
192 getChildEventComposites().clear();
193 getTraceEvents().clear();
194 next_good_time
= insertionTime
;
198 * Event Time reflecting the creation of this local resource e.g. at Reception of Fork, etc.
202 public long getInsertionTime() {
203 return insertionTime
;
This page took 0.03563 seconds and 5 git commands to generate.