Commit | Line | Data |
---|---|---|
49ffadb7 PT |
1 | /*******************************************************************************\r |
2 | * Copyright (c) 2012 Ericsson\r | |
27f3a03d | 3 | *\r |
49ffadb7 PT |
4 | * All rights reserved. This program and the accompanying materials are\r |
5 | * made available under the terms of the Eclipse Public License v1.0 which\r | |
6 | * accompanies this distribution, and is available at\r | |
7 | * http://www.eclipse.org/legal/epl-v10.html\r | |
27f3a03d | 8 | *\r |
49ffadb7 PT |
9 | * Contributors:\r |
10 | * Patrick Tasse - Initial API and implementation\r | |
11 | *******************************************************************************/\r | |
12 | \r | |
13 | package org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources;\r | |
14 | \r | |
15 | import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type;\r | |
16 | import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent;\r | |
17 | \r | |
27f3a03d AM |
18 | /**\r |
19 | * Time Event implementation specific to the Resource View\r | |
20 | *\r | |
21 | * @author Patrick Tasse\r | |
22 | */\r | |
49ffadb7 PT |
23 | public class ResourcesEvent extends TimeEvent {\r |
24 | \r | |
27f3a03d | 25 | private final Type fType;\r |
49ffadb7 PT |
26 | private int fValue;\r |
27 | \r | |
27f3a03d AM |
28 | /**\r |
29 | * Standard constructor\r | |
30 | *\r | |
31 | * @param entry\r | |
32 | * The entry that this event affects\r | |
33 | * @param time\r | |
34 | * The start time of the event\r | |
35 | * @param duration\r | |
36 | * The duration of the event\r | |
37 | * @param value\r | |
38 | * The value type associated to this event\r | |
39 | */\r | |
40 | public ResourcesEvent(ResourcesEntry entry, long time, long duration,\r | |
41 | int value) {\r | |
49ffadb7 PT |
42 | super(entry, time, duration);\r |
43 | fType = entry.getType();\r | |
44 | fValue = value;\r | |
45 | }\r | |
46 | \r | |
27f3a03d AM |
47 | /**\r |
48 | * Base constructor, with no value assigned\r | |
49 | *\r | |
50 | * @param entry\r | |
51 | * The entry that this event affects\r | |
52 | * @param time\r | |
53 | * The start time of the event\r | |
54 | * @param duration\r | |
55 | * The duration of the event\r | |
56 | */\r | |
49ffadb7 PT |
57 | public ResourcesEvent(ResourcesEntry entry, long time, long duration) {\r |
58 | super(entry, time, duration);\r | |
59 | fType = Type.NULL;\r | |
60 | }\r | |
61 | \r | |
27f3a03d AM |
62 | /**\r |
63 | * Retrieve the value associated with this event\r | |
64 | *\r | |
65 | * @return The integer value\r | |
66 | */\r | |
49ffadb7 PT |
67 | public int getValue() {\r |
68 | return fValue;\r | |
69 | }\r | |
70 | \r | |
27f3a03d AM |
71 | /**\r |
72 | * Retrieve the type of this entry. Uses the ResourcesEntry.Type interface.\r | |
73 | *\r | |
74 | * @return The entry type\r | |
75 | */\r | |
49ffadb7 PT |
76 | public Type getType() {\r |
77 | return fType;\r | |
78 | }\r | |
79 | }\r |