Commit | Line | Data |
---|---|---|
a52fde77 | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2012, 2014 Ericsson |
2cb26548 | 3 | * |
a52fde77 AM |
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 | |
2cb26548 | 8 | * |
a52fde77 AM |
9 | * Contributors: |
10 | * Alexandre Montplaisir - Initial API | |
11 | ******************************************************************************/ | |
12 | ||
e894a508 | 13 | package org.eclipse.tracecompass.statesystem.core.interval; |
a52fde77 | 14 | |
e894a508 | 15 | import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue; |
a52fde77 AM |
16 | |
17 | /** | |
18 | * This is the basic interface for accessing state intervals. See | |
19 | * StateInterval.java for a basic implementation. | |
2cb26548 | 20 | * |
a52fde77 AM |
21 | * A StateInterval is meant to be immutable. All implementing (non-abstract) |
22 | * classes should ideally be marked as 'final'. | |
2cb26548 | 23 | * |
2cb26548 | 24 | * @author Alexandre Montplaisir |
a52fde77 AM |
25 | */ |
26 | public interface ITmfStateInterval { | |
27 | ||
28 | /** | |
29 | * Retrieve the start time of the interval | |
2cb26548 | 30 | * |
0d9a6d76 | 31 | * @return the start time of the interval |
a52fde77 | 32 | */ |
57a2a5ca | 33 | long getStartTime(); |
a52fde77 AM |
34 | |
35 | /** | |
36 | * Retrieve the end time of the interval | |
2cb26548 | 37 | * |
0d9a6d76 | 38 | * @return the end time of the interval |
a52fde77 | 39 | */ |
57a2a5ca | 40 | long getEndTime(); |
a52fde77 | 41 | |
eaad89a0 AM |
42 | /** |
43 | * In case the "real" end time of the interval is not exactly the same as | |
44 | * the end time you want to show in views, you can implement this method to | |
45 | * assign a different value that the viewer can use. | |
2cb26548 | 46 | * |
eaad89a0 | 47 | * If not, you can simply have it return the same as getEndTime(). |
2cb26548 | 48 | * |
eaad89a0 AM |
49 | * @return The end time that views should use |
50 | */ | |
57a2a5ca | 51 | long getViewerEndTime(); |
eaad89a0 | 52 | |
a52fde77 AM |
53 | /** |
54 | * Retrieve the quark of the attribute this state interval refers to | |
2cb26548 | 55 | * |
0d9a6d76 | 56 | * @return the quark of the attribute this state interval refers to |
a52fde77 | 57 | */ |
57a2a5ca | 58 | int getAttribute(); |
a52fde77 AM |
59 | |
60 | /** | |
61 | * Retrieve the state value represented by this interval | |
2cb26548 | 62 | * |
0d9a6d76 | 63 | * @return the state value represented by this interval |
a52fde77 | 64 | */ |
57a2a5ca | 65 | ITmfStateValue getStateValue(); |
a52fde77 AM |
66 | |
67 | /** | |
68 | * Test if this interval intersects another timestamp, inclusively. | |
2cb26548 | 69 | * |
a52fde77 AM |
70 | * @param timestamp |
71 | * The target timestamp | |
72 | * @return True if the interval and timestamp intersect, false if they don't | |
73 | */ | |
57a2a5ca | 74 | boolean intersects(long timestamp); |
a52fde77 | 75 | } |