1 /*******************************************************************************
2 * Copyright (c) 2012 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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.resources
;
15 import java
.util
.ArrayList
;
16 import java
.util
.Iterator
;
17 import java
.util
.List
;
19 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.common
.EventIterator
;
20 import org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.trace
.CtfKernelTrace
;
21 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeEvent
;
22 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeGraphEntry
;
24 public class ResourcesEntry
implements ITimeGraphEntry
{
25 public static enum Type
{ NULL
, CPU
, IRQ
, SOFT_IRQ
};
28 private CtfKernelTrace fTrace
;
29 private ITimeGraphEntry fParent
= null;
30 private ITimeGraphEntry
[] children
= null;
34 private long fStartTime
;
35 private long fEndTime
;
36 private List
<ITimeEvent
> fEventList
= new ArrayList
<ITimeEvent
>();
37 private List
<ITimeEvent
> fZoomedEventList
= null;
39 public ResourcesEntry(int quark
, CtfKernelTrace trace
, Type type
, int id
) {
44 fName
= type
.toString() + ' ' + Integer
.toString(id
);
48 public ITimeGraphEntry
getParent() {
53 public boolean hasChildren() {
54 return children
!= null && children
.length
> 0;
58 public ITimeGraphEntry
[] getChildren() {
63 public String
getName() {
68 public long getStartTime() {
73 public long getEndTime() {
78 public Iterator
<ITimeEvent
> getTimeEventsIterator() {
79 return new EventIterator(fEventList
, fZoomedEventList
);
83 public Iterator
<ITimeEvent
> getTimeEventsIterator(long startTime
, long stopTime
, long visibleDuration
) {
84 return new EventIterator(fEventList
, fZoomedEventList
, startTime
, stopTime
);
87 public void setParent(ITimeGraphEntry parent
) {
91 public int getQuark() {
95 public CtfKernelTrace
getTrace() {
99 public Type
getType() {
107 public void setEventList(List
<ITimeEvent
> eventList
) {
108 fEventList
= eventList
;
109 if (eventList
!= null && eventList
.size() > 0) {
110 fStartTime
= eventList
.get(0).getTime();
111 ITimeEvent lastEvent
= eventList
.get(eventList
.size() - 1);
112 fEndTime
= lastEvent
.getTime() + lastEvent
.getDuration();
116 public void setZoomedEventList(List
<ITimeEvent
> eventList
) {
117 fZoomedEventList
= eventList
;
This page took 0.03241 seconds and 5 git commands to generate.