1 /*******************************************************************************
2 * Copyright (c) 2009 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
.trace
;
15 import java
.io
.FileNotFoundException
;
16 import java
.io
.IOException
;
17 import java
.io
.RandomAccessFile
;
20 import org
.eclipse
.linuxtools
.tmf
.event
.TmfEvent
;
23 * <b><u>TmfTraceStub</u></b>
25 * TODO: Implement me. Please.
27 public class TmfTraceStub
extends TmfTrace
{
29 // ========================================================================
31 // ========================================================================
34 private final RandomAccessFile fTrace
;
36 // The associated event parser
37 private final ITmfEventParser fParser
;
39 // ========================================================================
41 // ========================================================================
45 * @throws FileNotFoundException
47 public TmfTraceStub(String filename
) throws FileNotFoundException
{
48 this(filename
, DEFAULT_PAGE_SIZE
);
54 * @throws FileNotFoundException
56 public TmfTraceStub(String filename
, int cacheSize
) throws FileNotFoundException
{
57 super(filename
, cacheSize
);
58 fTrace
= new RandomAccessFile(filename
, "r");
59 fParser
= new TmfEventParserStub();
63 // ========================================================================
65 // ========================================================================
67 public RandomAccessFile
getStream() {
71 // ========================================================================
73 // ========================================================================
76 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#seekLocation(java.lang.Object)
78 public TmfTraceContext
seekLocation(Object location
) {
79 TmfTraceContext context
= null;
81 fTrace
.seek((location
!= null) ?
(Long
) location
: 0);
82 context
= new TmfTraceContext(getCurrentLocation(), 0);
83 } catch (IOException e
) {
84 // TODO Auto-generated catch block
91 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#getCurrentLocation()
93 public Object
getCurrentLocation() {
95 return new Long(fTrace
.getFilePointer());
96 } catch (IOException e
) {
97 // TODO Auto-generated catch block
104 * @see org.eclipse.linuxtools.tmf.trace.TmfTrace#parseEvent()
106 public TmfEvent
parseNextEvent() {
108 TmfEvent event
= fParser
.getNextEvent(this);
111 catch (IOException e
) {
117 // ========================================================================
119 // ========================================================================
122 * @see org.eclipse.linuxtools.tmf.eventlog.ITmfEventStream#getAttributes()
124 public Map
<String
, Object
> getAttributes() {
125 // TODO Auto-generated method stub
This page took 0.032203 seconds and 5 git commands to generate.