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
.core
.resources
.IResource
;
19 import org
.eclipse
.linuxtools
.tmf
.core
.component
.ITmfComponent
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEvent
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfTimestamp
;
22 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimeRange
;
25 * <b><u>ITmfTrace</u></b>
28 public interface ITmfTrace
<T
extends ITmfEvent
> extends ITmfComponent
{
31 public void initTrace(String name
, String path
, Class
<T
> eventType
) throws FileNotFoundException
;
33 public void initTrace(String name
, String path
, Class
<T
> eventType
, int cacheSize
) throws FileNotFoundException
;
35 public void initTrace(String name
, String path
, Class
<T
> eventType
, boolean indexTrace
) throws FileNotFoundException
;
37 public void initTrace(String name
, String path
, Class
<T
> eventType
, int cacheSize
, boolean indexTrace
) throws FileNotFoundException
;
39 // Trace type validation
40 public boolean validate(IProject project
, String path
);
42 public ITmfTrace
<T
> copy();
45 * @return the trace path
47 public String
getPath();
50 * @return the trace name
53 public String
getName();
56 * @return the cache size
58 public int getCacheSize();
61 * @return the number of events in the trace
63 public long getNbEvents();
66 * Trace time range accesses
68 public TmfTimeRange
getTimeRange();
70 public ITmfTimestamp
getStartTime();
72 public ITmfTimestamp
getEndTime();
75 * @return the streaming interval in ms (0 if not streaming)
77 public long getStreamingInterval();
80 * Positions the trace at the first event with the specified timestamp or index (i.e. the nth event in the trace).
82 * Returns a context which can later be used to read the event.
85 * @return a context object for subsequent reads
87 public ITmfContext
seekLocation(ITmfLocation
<?
> location
);
89 public ITmfContext
seekEvent(ITmfTimestamp timestamp
);
91 public ITmfContext
seekEvent(long rank
);
94 * Positions the trace at the event located at the specified ratio.
96 * Returns a context which can later be used to read the event.
99 * a floating-point number between 0.0 (beginning) and 1.0 (end)
100 * @return a context object for subsequent reads
102 public ITmfContext
seekLocation(double ratio
);
105 * Returns the ratio corresponding to the specified location.
109 * @return a floating-point number between 0.0 (beginning) and 1.0 (end)
111 public double getLocationRatio(ITmfLocation
<?
> location
);
113 public ITmfLocation
<?
> getCurrentLocation();
116 * Returns the rank of the first event with the requested timestamp. If none, returns the index of the next event
119 * @param timestamp the requested event timestamp
120 * @return the corresponding event rank
122 public long getRank(ITmfTimestamp timestamp
);
125 * Return the event pointed by the supplied context (or null if no event left) and updates the context to the next
128 * @return the next event in the stream
130 public ITmfEvent
getNextEvent(ITmfContext context
);
133 * Return the event pointed by the supplied context (or null if no event left) and *does not* update the context.
135 * @return the next event in the stream
137 public ITmfEvent
parseEvent(ITmfContext context
);
140 * Set the resource used for persistent properties on this trace
141 * @param resource the properties resource
143 public void setResource(IResource resource
);
146 * Get the resource used for persistent properties on this trace
147 * @return the properties resource or null if none is set
149 public IResource
getResource();
This page took 0.033638 seconds and 6 git commands to generate.