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