Commit | Line | Data |
---|---|---|
a52fde77 AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012 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 | ||
13 | package org.eclipse.linuxtools.tmf.core.interval; | |
14 | ||
15 | import org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue; | |
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 AM |
23 | * |
24 | * @version 1.0 | |
25 | * @author Alexandre Montplaisir | |
a52fde77 AM |
26 | */ |
27 | public interface ITmfStateInterval { | |
28 | ||
29 | /** | |
30 | * Retrieve the start time of the interval | |
2cb26548 | 31 | * |
0d9a6d76 | 32 | * @return the start time of the interval |
a52fde77 AM |
33 | */ |
34 | public long getStartTime(); | |
35 | ||
36 | /** | |
37 | * Retrieve the end time of the interval | |
2cb26548 | 38 | * |
0d9a6d76 | 39 | * @return the end time of the interval |
a52fde77 AM |
40 | */ |
41 | public long getEndTime(); | |
42 | ||
eaad89a0 AM |
43 | /** |
44 | * In case the "real" end time of the interval is not exactly the same as | |
45 | * the end time you want to show in views, you can implement this method to | |
46 | * assign a different value that the viewer can use. | |
2cb26548 | 47 | * |
eaad89a0 | 48 | * If not, you can simply have it return the same as getEndTime(). |
2cb26548 | 49 | * |
eaad89a0 AM |
50 | * @return The end time that views should use |
51 | */ | |
52 | public long getViewerEndTime(); | |
53 | ||
a52fde77 AM |
54 | /** |
55 | * Retrieve the quark of the attribute this state interval refers to | |
2cb26548 | 56 | * |
0d9a6d76 | 57 | * @return the quark of the attribute this state interval refers to |
a52fde77 AM |
58 | */ |
59 | public int getAttribute(); | |
60 | ||
61 | /** | |
62 | * Retrieve the state value represented by this interval | |
2cb26548 | 63 | * |
0d9a6d76 | 64 | * @return the state value represented by this interval |
a52fde77 AM |
65 | */ |
66 | public ITmfStateValue getStateValue(); | |
67 | ||
68 | /** | |
69 | * Test if this interval intersects another timestamp, inclusively. | |
2cb26548 | 70 | * |
a52fde77 AM |
71 | * @param timestamp |
72 | * The target timestamp | |
73 | * @return True if the interval and timestamp intersect, false if they don't | |
74 | */ | |
75 | public boolean intersects(long timestamp); | |
76 | } |