Ctf: Callsite bug fix when position is negative (binarySearch)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.ui / src / org / eclipse / linuxtools / internal / lttng2 / kernel / ui / views / resources / ResourcesEvent.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources;
14
15 import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type;
16 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent;
17
18 /**
19 * Time Event implementation specific to the Resource View
20 *
21 * @author Patrick Tasse
22 */
23 public class ResourcesEvent extends TimeEvent {
24
25 private final Type fType;
26 private int fValue;
27
28 /**
29 * Standard constructor
30 *
31 * @param entry
32 * The entry that this event affects
33 * @param time
34 * The start time of the event
35 * @param duration
36 * The duration of the event
37 * @param value
38 * The value type associated to this event
39 */
40 public ResourcesEvent(ResourcesEntry entry, long time, long duration,
41 int value) {
42 super(entry, time, duration);
43 fType = entry.getType();
44 fValue = value;
45 }
46
47 /**
48 * Base constructor, with no value assigned
49 *
50 * @param entry
51 * The entry that this event affects
52 * @param time
53 * The start time of the event
54 * @param duration
55 * The duration of the event
56 */
57 public ResourcesEvent(ResourcesEntry entry, long time, long duration) {
58 super(entry, time, duration);
59 fType = Type.NULL;
60 }
61
62 /**
63 * Retrieve the value associated with this event
64 *
65 * @return The integer value
66 */
67 public int getValue() {
68 return fValue;
69 }
70
71 /**
72 * Retrieve the type of this entry. Uses the ResourcesEntry.Type interface.
73 *
74 * @return The entry type
75 */
76 public Type getType() {
77 return fType;
78 }
79
80 @Override
81 public String toString() {
82 return "ResourcesEvent start=" + fTime + " end=" + (fTime + fDuration) + " duration=" + fDuration + " type=" + fType + " value=" + fValue; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
83 }
84 }
This page took 0.031936 seconds and 5 git commands to generate.