Commit | Line | Data |
---|---|---|
735b1ca2 AM |
1 | /* |
2 | * Copyright (C) 2016-2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com> | |
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.arrows; | |
11 | ||
12 | import java.util.Collection; | |
13 | import java.util.Collections; | |
14 | ||
15 | import org.lttng.scope.tmf2.views.core.TimeRange; | |
16 | ||
17 | import com.google.common.collect.ImmutableList; | |
18 | ||
19 | /** | |
20 | * Render of time graph arrows, containing all possible arrows of a single | |
21 | * series for a given time range. | |
22 | * | |
23 | * @author Alexandre Montplaisir | |
24 | */ | |
25 | public class TimeGraphArrowRender { | |
26 | ||
27 | /** Empty arrow render, can be used instead of a null value */ | |
28 | public static final TimeGraphArrowRender EMPTY_RENDER = | |
29 | new TimeGraphArrowRender(TimeRange.of(0, 0), Collections.EMPTY_LIST); | |
30 | ||
31 | private final TimeRange fTimeRange; | |
32 | private final Collection<TimeGraphArrow> fArrows; | |
33 | ||
34 | /** | |
35 | * Constructor | |
36 | * | |
37 | * @param range | |
38 | * Time range of this arrow render. For reference only, should | |
39 | * probably match the time range of the query that created this | |
40 | * render. | |
41 | * @param arrows | |
42 | * The arrows contained in this render. | |
43 | */ | |
44 | public TimeGraphArrowRender(TimeRange range, Iterable<TimeGraphArrow> arrows) { | |
45 | fTimeRange = range; | |
46 | fArrows = ImmutableList.copyOf(arrows); | |
47 | } | |
48 | ||
49 | /** | |
50 | * Get the time range of this arrow render. | |
51 | * | |
52 | * @return The time range | |
53 | */ | |
54 | public TimeRange getTimeRange() { | |
55 | return fTimeRange; | |
56 | } | |
57 | ||
58 | /** | |
59 | * Get the arrows contained in this render. | |
60 | * | |
61 | * @return The arrows | |
62 | */ | |
63 | public Collection<TimeGraphArrow> getArrows() { | |
64 | return fArrows; | |
65 | } | |
66 | ||
67 | } |