Commit | Line | Data |
---|---|---|
be222f56 | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2009, 2014 Ericsson |
be222f56 PT |
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 | * Alvaro Sanchez-Leon - Initial API and implementation | |
11 | * Patrick Tasse - Refactoring | |
12 | *******************************************************************************/ | |
13 | ||
2bdf0193 | 14 | package org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model; |
be222f56 PT |
15 | |
16 | import java.util.Iterator; | |
30652cc3 | 17 | import java.util.List; |
be222f56 PT |
18 | |
19 | /** | |
20 | * Interface for an entry (row) in the time graph view | |
21 | * | |
22 | * @version 1.0 | |
23 | * @author Alvaro Sanchez-Leon | |
24 | * @author Patrick Tasse | |
25 | */ | |
26 | public interface ITimeGraphEntry { | |
27 | ||
28 | /** | |
29 | * Returns the parent of this entry, or <code>null</code> if it has none. | |
30 | * | |
31 | * @return the parent element, or <code>null</code> if it has none | |
32 | */ | |
57a2a5ca | 33 | ITimeGraphEntry getParent(); |
be222f56 PT |
34 | |
35 | /** | |
36 | * Returns whether this entry has children. | |
37 | * | |
38 | * @return <code>true</code> if the given element has children, | |
39 | * and <code>false</code> if it has no children | |
40 | */ | |
57a2a5ca | 41 | boolean hasChildren(); |
be222f56 PT |
42 | |
43 | /** | |
44 | * Returns the child elements of this entry. | |
45 | * | |
46 | * @return an array of child elements | |
30652cc3 | 47 | * @since 2.0 |
be222f56 | 48 | */ |
57a2a5ca | 49 | List<? extends ITimeGraphEntry> getChildren(); |
be222f56 PT |
50 | |
51 | /** | |
52 | * Returns the name of this entry. | |
53 | * | |
54 | * @return the entry name | |
55 | */ | |
57a2a5ca | 56 | String getName(); |
be222f56 PT |
57 | |
58 | /** | |
59 | * Returns the start time of this entry in nanoseconds. | |
60 | * | |
61 | * @return the start time | |
62 | */ | |
57a2a5ca | 63 | long getStartTime(); |
be222f56 PT |
64 | |
65 | /** | |
66 | * Returns the end time of this entry in nanoseconds. | |
67 | * | |
68 | * @return the end time | |
69 | */ | |
57a2a5ca | 70 | long getEndTime(); |
be222f56 PT |
71 | |
72 | /** | |
73 | * Returns whether this entry has time events. | |
74 | * If true, the time events iterator should not be null. | |
75 | * | |
76 | * @return true if the entry has time events | |
77 | * | |
78 | * @see #getTimeEventsIterator | |
79 | * @see #getTimeEventsIterator(long, long, long) | |
80 | */ | |
57a2a5ca | 81 | boolean hasTimeEvents(); |
be222f56 PT |
82 | |
83 | /** | |
84 | * Get an iterator which returns all time events. | |
85 | * | |
86 | * @return the iterator | |
87 | */ | |
57a2a5ca | 88 | <T extends ITimeEvent> Iterator<T> getTimeEventsIterator(); |
be222f56 PT |
89 | |
90 | /** | |
91 | * Get an iterator which only returns events that fall within the start time and the stop time. | |
92 | * The visible duration is the event duration below which further detail is not discernible. | |
93 | * If no such iterator is implemented, provide a basic iterator which returns all events. | |
94 | * | |
95 | * @param startTime start time in nanoseconds | |
96 | * @param stopTime stop time in nanoseconds | |
97 | * @param visibleDuration duration of one pixel in nanoseconds | |
98 | * | |
99 | * @return the iterator | |
100 | */ | |
57a2a5ca | 101 | <T extends ITimeEvent> Iterator<T> getTimeEventsIterator(long startTime, long stopTime, long visibleDuration); |
be222f56 | 102 | } |