Import views plugins
[deliverable/tracecompass.git] / tmf / org.lttng.scope.tmf2.views.core / src / org / lttng / scope / tmf2 / views / core / timegraph / model / render / states / TimeGraphStateRender.java
1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
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
10 package org.lttng.scope.tmf2.views.core.timegraph.model.render.states;
11
12 import java.util.Collections;
13 import java.util.List;
14
15 import org.lttng.scope.tmf2.views.core.TimeRange;
16 import org.lttng.scope.tmf2.views.core.timegraph.model.render.tree.TimeGraphTreeElement;
17
18 import com.google.common.collect.ImmutableList;
19
20 /**
21 * "Segment" of a time graph, representing the states of a single tree element
22 * for a given time range.
23 *
24 * @author Alexandre Montplaisir
25 */
26 public class TimeGraphStateRender {
27
28 /** Non-null reference to a dummy/empty render */
29 public static final TimeGraphStateRender EMPTY_RENDER = new TimeGraphStateRender(TimeRange.of(0, 0), TimeGraphTreeElement.DUMMY_ELEMENT, Collections.emptyList());
30
31 private final TimeRange fTimeRange;
32 private final TimeGraphTreeElement fTreeElement;
33 private final List<TimeGraphStateInterval> fStateIntervals;
34
35 /**
36 * Constructor
37 *
38 * @param timeRange
39 * The time range of this state render. This is for informative
40 * use mostly, and usually matches the time range that was
41 * requested for the query that generated this render.
42 * @param treeElement
43 * This render contains state intervals of this single tree
44 * element
45 * @param stateIntervals
46 * The state intervals that are part of this render. Their range
47 * should normally match the 'timeRange' parameter.
48 */
49 public TimeGraphStateRender(TimeRange timeRange,
50 TimeGraphTreeElement treeElement,
51 List<TimeGraphStateInterval> stateIntervals) {
52
53 fTimeRange = timeRange;
54 fTreeElement = treeElement;
55 fStateIntervals = ImmutableList.copyOf(stateIntervals);
56 }
57
58 /**
59 * Get the time range of this interval.
60 *
61 * @return The time range
62 */
63 public TimeRange getTimeRange() {
64 return fTimeRange;
65 }
66
67 /**
68 * Get the tree element to which the intervals of this render belongs.
69 *
70 * @return The tree element
71 */
72 public TimeGraphTreeElement getTreeElement() {
73 return fTreeElement;
74 }
75
76 /**
77 * Get the state intervals that are part of this state render
78 *
79 * @return The state intervals
80 */
81 public List<TimeGraphStateInterval> getStateIntervals() {
82 return fStateIntervals;
83 }
84
85 }
This page took 0.033683 seconds and 5 git commands to generate.