1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 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
.component
;
16 import java
.io
.IOException
;
17 import java
.net
.URISyntaxException
;
20 import org
.eclipse
.core
.runtime
.FileLocator
;
21 import org
.eclipse
.core
.runtime
.Path
;
22 import org
.eclipse
.linuxtools
.tmf
.event
.TmfEvent
;
23 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimestamp
;
24 import org
.eclipse
.linuxtools
.tmf
.request
.TmfDataRequest
;
25 import org
.eclipse
.linuxtools
.tmf
.request
.TmfEventRequest
;
26 import org
.eclipse
.linuxtools
.tmf
.tests
.TmfCoreTestPlugin
;
27 import org
.eclipse
.linuxtools
.tmf
.trace
.TmfTraceContext
;
28 import org
.eclipse
.linuxtools
.tmf
.trace
.TmfTraceStub
;
31 * <b><u>TmfProviderStub</u></b>
33 * TODO: Implement me. Please.
35 public class TmfProviderStub
extends TmfProvider
<TmfEvent
> {
37 private TmfTraceStub fTrace
;
39 public TmfProviderStub(String path
) throws IOException
{
40 super(TmfEvent
.class);
41 URL location
= FileLocator
.find(TmfCoreTestPlugin
.getPlugin().getBundle(), new Path(path
), null);
43 File test
= new File(FileLocator
.toFileURL(location
).toURI());
44 fTrace
= new TmfTraceStub(test
.getPath(), true);
45 } catch (URISyntaxException e
) {
51 public ITmfContext
setContext(TmfDataRequest
<TmfEvent
> request
) {
52 if (request
instanceof TmfEventRequest
<?
>) {
53 TmfTraceContext context
= fTrace
.seekEvent(((TmfEventRequest
<?
>) request
).getRange().getStartTime());
60 public TmfEvent
getNext(ITmfContext context
) {
61 return fTrace
.getNext(context
);
65 public boolean isCompleted(TmfDataRequest
<TmfEvent
> request
, TmfEvent event
) {
66 TmfTimestamp endTime
= ((TmfEventRequest
<?
>) request
).getRange().getEndTime();
67 return event
.getTimestamp().compareTo(endTime
, false) <= 0;
This page took 0.032328 seconds and 5 git commands to generate.