Minor API improvements
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / ITmfContext.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010, 2012 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 * Francois Chouinard - Initial API and implementation
11 * Francois Chouinard - Updated as per TMF Trace Model 1.0
12 *******************************************************************************/
13
14 package org.eclipse.linuxtools.tmf.core.trace;
15
16 /**
17 * <b><u>ITmfContext</u></b>
18 * <p>
19 * The basic trace context structure in TMF. The purpose of the context is to
20 * associate a trace location to an event of a specific rank (order).
21 * <p>
22 * The context should be sufficient to allow the trace to position itself so
23 * that performing a trace read operation will yield the corresponding event.
24 */
25 public interface ITmfContext extends Cloneable {
26
27 // ------------------------------------------------------------------------
28 // Constants
29 // ------------------------------------------------------------------------
30
31 /**
32 * The unknown event rank
33 */
34 public long UNKNOWN_RANK = -1L;
35
36 // ------------------------------------------------------------------------
37 // Getters
38 // ------------------------------------------------------------------------
39
40 /**
41 * @return the rank of the event referred to by the context
42 */
43 public long getRank();
44
45 /**
46 * @return the location of the event referred to by the context
47 */
48 public ITmfLocation<? extends Comparable<?>> getLocation();
49
50 /**
51 * @return indicates if the context rank is valid (!= UNKNOWN_RANK)
52 */
53 public boolean hasValidRank();
54
55 // ------------------------------------------------------------------------
56 // Operations
57 // ------------------------------------------------------------------------
58
59 /**
60 * @param location the new location
61 */
62 public void setLocation(ITmfLocation<? extends Comparable<?>> location);
63
64 /**
65 * @param rank the new rank
66 */
67 public void setRank(long rank);
68
69 /**
70 * Increment the context rank
71 */
72 public void increaseRank();
73
74 /**
75 * Cleanup hook
76 */
77 public void dispose();
78
79 // ------------------------------------------------------------------------
80 // Cloneable
81 // ------------------------------------------------------------------------
82
83 /**
84 * @return a clone of the context
85 */
86 public ITmfContext clone();
87
88 }
This page took 0.033191 seconds and 5 git commands to generate.