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
.ITmfTimestamp
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfEvent
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimeRange
;
24 * <b><u>ITmfTrace</u></b>
27 public interface ITmfTrace
<T
extends TmfEvent
> extends ITmfComponent
{
30 public void initTrace(String name
, String path
, Class
<T
> eventType
) throws FileNotFoundException
;
32 public void initTrace(String name
, String path
, Class
<T
> eventType
, int cacheSize
) throws FileNotFoundException
;
34 public void initTrace(String name
, String path
, Class
<T
> eventType
, boolean indexTrace
) throws FileNotFoundException
;
36 public void initTrace(String name
, String path
, Class
<T
> eventType
, int cacheSize
, boolean indexTrace
) throws FileNotFoundException
;
38 // Trace type validation
39 public boolean validate(IProject project
, String path
);
41 public ITmfTrace
<T
> copy();
44 * @return the trace path
46 public String
getPath();
49 * @return the trace name
52 public String
getName();
55 * @return the cache size
57 public int getCacheSize();
60 * @return the number of events in the trace
62 public long getNbEvents();
65 * Trace time range accesses
67 public TmfTimeRange
getTimeRange();
69 public ITmfTimestamp
getStartTime();
71 public ITmfTimestamp
getEndTime();
74 * @return the streaming interval in ms (0 if not streaming)
76 public long getStreamingInterval();
79 * Positions the trace at the first event with the specified timestamp or index (i.e. the nth event in the trace).
81 * Returns a context which can later be used to read the event.
86 * @return a context object for subsequent reads
88 public TmfContext
seekLocation(ITmfLocation
<?
> location
);
90 public TmfContext
seekEvent(ITmfTimestamp timestamp
);
92 public TmfContext
seekEvent(long rank
);
95 * Positions the trace at the event located at the specified ratio.
97 * Returns a context which can later be used to read the event.
100 * a floating-point number between 0.0 (beginning) and 1.0 (end)
101 * @return a context object for subsequent reads
103 public TmfContext
seekLocation(double ratio
);
106 * Returns the ratio corresponding to the specified location.
110 * @return a floating-point number between 0.0 (beginning) and 1.0 (end)
112 public double getLocationRatio(ITmfLocation
<?
> location
);
114 public ITmfLocation
<?
> getCurrentLocation();
117 * Returns the rank of the first event with the requested timestamp. If none, returns the index of the next event
123 public long getRank(ITmfTimestamp timestamp
);
126 * Return the event pointed by the supplied context (or null if no event left) and updates the context to the next
129 * @return the next event in the stream
131 public TmfEvent
getNextEvent(TmfContext context
);
134 * Return the event pointed by the supplied context (or null if no event left) and *does not* update the context.
136 * @return the next event in the stream
138 public TmfEvent
parseEvent(TmfContext context
);
This page took 0.034589 seconds and 6 git commands to generate.