1 /*******************************************************************************
2 * Copyright (c) 2009, 2011 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.trace
;
15 import java
.io
.FileNotFoundException
;
17 import org
.eclipse
.core
.resources
.IProject
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.component
.ITmfComponent
;
19 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfEvent
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimeRange
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimestamp
;
24 * <b><u>ITmfTrace</u></b>
27 public interface ITmfTrace
<T
extends TmfEvent
> extends ITmfComponent
{
30 public void initTrace(String path
, Class
<T
> eventType
) throws FileNotFoundException
;
32 public void initTrace(String path
, Class
<T
> eventType
, int cacheSize
) throws FileNotFoundException
;
34 public void initTrace(String path
, Class
<T
> eventType
, boolean indexTrace
) throws FileNotFoundException
;
36 public void initTrace(String path
, Class
<T
> eventType
, int cacheSize
, boolean indexTrace
) throws FileNotFoundException
;
38 public void initTrace(String path
, Class
<T
> eventType
, int cacheSize
, boolean indexTrace
, String name
) throws FileNotFoundException
;
40 // Trace type validation
41 public boolean validate(IProject project
, String path
);
43 public ITmfTrace
<T
> copy();
46 * @return the trace path
48 public String
getPath();
51 * @return the trace name
54 public String
getName();
57 * @return the cache size
59 public int getCacheSize();
62 * @return the number of events in the trace
64 public long getNbEvents();
67 * Trace time range accesses
69 public TmfTimeRange
getTimeRange();
71 public TmfTimestamp
getStartTime();
73 public TmfTimestamp
getEndTime();
76 * @return the streaming interval in ms (0 if not streaming)
78 public long getStreamingInterval();
81 * Positions the trace at the first event with the specified timestamp or index (i.e. the nth event in the trace).
83 * Returns a context which can later be used to read the event.
88 * @return a context object for subsequent reads
90 public TmfContext
seekLocation(ITmfLocation
<?
> location
);
92 public TmfContext
seekEvent(TmfTimestamp timestamp
);
94 public TmfContext
seekEvent(long rank
);
97 * Positions the trace at the event located at the specified ratio.
99 * Returns a context which can later be used to read the event.
102 * a floating-point number between 0.0 (beginning) and 1.0 (end)
103 * @return a context object for subsequent reads
105 public TmfContext
seekLocation(double ratio
);
108 * Returns the ratio corresponding to the specified location.
112 * @return a floating-point number between 0.0 (beginning) and 1.0 (end)
114 public double getLocationRatio(ITmfLocation
<?
> location
);
116 public ITmfLocation
<?
> getCurrentLocation();
119 * Returns the rank of the first event with the requested timestamp. If none, returns the index of the next event
125 public long getRank(TmfTimestamp timestamp
);
128 * Return the event pointed by the supplied context (or null if no event left) and updates the context to the next
131 * @return the next event in the stream
133 public TmfEvent
getNextEvent(TmfContext context
);
136 * Return the event pointed by the supplied context (or null if no event left) and *does not* update the context.
138 * @return the next event in the stream
140 public TmfEvent
parseEvent(TmfContext context
);
This page took 0.035545 seconds and 6 git commands to generate.