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