05fa3ac55bbffbca5a04dd219bdd754b8a4ef462
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.statesystem.core / src / org / eclipse / tracecompass / statesystem / core / interval / ITmfStateInterval.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 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 * Alexandre Montplaisir - Initial API
11 ******************************************************************************/
12
13 package org.eclipse.tracecompass.statesystem.core.interval;
14
15 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
16
17 /**
18 * This is the basic interface for accessing state intervals. See
19 * StateInterval.java for a basic implementation.
20 *
21 * A StateInterval is meant to be immutable. All implementing (non-abstract)
22 * classes should ideally be marked as 'final'.
23 *
24 * @author Alexandre Montplaisir
25 */
26 public interface ITmfStateInterval {
27
28 /**
29 * Retrieve the start time of the interval
30 *
31 * @return the start time of the interval
32 */
33 long getStartTime();
34
35 /**
36 * Retrieve the end time of the interval
37 *
38 * @return the end time of the interval
39 */
40 long getEndTime();
41
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.
46 *
47 * If not, you can simply have it return the same as getEndTime().
48 *
49 * @return The end time that views should use
50 */
51 long getViewerEndTime();
52
53 /**
54 * Retrieve the quark of the attribute this state interval refers to
55 *
56 * @return the quark of the attribute this state interval refers to
57 */
58 int getAttribute();
59
60 /**
61 * Retrieve the state value represented by this interval
62 *
63 * @return the state value represented by this interval
64 */
65 ITmfStateValue getStateValue();
66
67 /**
68 * Test if this interval intersects another timestamp, inclusively.
69 *
70 * @param timestamp
71 * The target timestamp
72 * @return True if the interval and timestamp intersect, false if they don't
73 */
74 boolean intersects(long timestamp);
75 }
This page took 0.063321 seconds and 4 git commands to generate.