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 | |
df2597e0 | 15 | import org.eclipse.jdt.annotation.NonNull; |
e894a508 | 16 | import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue; |
a52fde77 AM |
17 | |
18 | /** | |
19 | * This is the basic interface for accessing state intervals. See | |
20 | * StateInterval.java for a basic implementation. | |
2cb26548 | 21 | * |
a52fde77 AM |
22 | * A StateInterval is meant to be immutable. All implementing (non-abstract) |
23 | * classes should ideally be marked as 'final'. | |
2cb26548 | 24 | * |
2cb26548 | 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 | 33 | */ |
57a2a5ca | 34 | long getStartTime(); |
a52fde77 AM |
35 | |
36 | /** | |
37 | * Retrieve the end time of the interval | |
2cb26548 | 38 | * |
0d9a6d76 | 39 | * @return the end time of the interval |
a52fde77 | 40 | */ |
57a2a5ca | 41 | long getEndTime(); |
a52fde77 AM |
42 | |
43 | /** | |
44 | * Retrieve the quark of the attribute this state interval refers to | |
2cb26548 | 45 | * |
0d9a6d76 | 46 | * @return the quark of the attribute this state interval refers to |
a52fde77 | 47 | */ |
57a2a5ca | 48 | int getAttribute(); |
a52fde77 AM |
49 | |
50 | /** | |
51 | * Retrieve the state value represented by this interval | |
2cb26548 | 52 | * |
0d9a6d76 | 53 | * @return the state value represented by this interval |
a52fde77 | 54 | */ |
df2597e0 | 55 | @NonNull ITmfStateValue getStateValue(); |
a52fde77 AM |
56 | |
57 | /** | |
58 | * Test if this interval intersects another timestamp, inclusively. | |
2cb26548 | 59 | * |
a52fde77 AM |
60 | * @param timestamp |
61 | * The target timestamp | |
62 | * @return True if the interval and timestamp intersect, false if they don't | |
63 | */ | |
57a2a5ca | 64 | boolean intersects(long timestamp); |
a52fde77 | 65 | } |