52f20ecbfb00e9a00790b053d99eb2924f3519a4
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core.tests / stubs / org / eclipse / tracecompass / tmf / tests / stubs / analysis / ondemand / OnDemandAnalysisStub.java
1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
3 *
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10 package org.eclipse.tracecompass.tmf.tests.stubs.analysis.ondemand;
11
12 import org.eclipse.core.runtime.IProgressMonitor;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.eclipse.jdt.annotation.Nullable;
15 import org.eclipse.tracecompass.tmf.core.analysis.ondemand.IOnDemandAnalysis;
16 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
17 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
18 import org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfTraceStub2;
19
20 /**
21 * Stub for on-demand analysis tests.
22 *
23 * It applies to trace type {@link TmfTraceStub2} only.
24 *
25 * @author Alexandre Montplaisir
26 */
27 @NonNullByDefault
28 public class OnDemandAnalysisStub implements IOnDemandAnalysis {
29
30 @Override
31 public String getName() {
32 return "Test On-Demand Analysis";
33 }
34
35 @Override
36 public boolean appliesTo(ITmfTrace trace) {
37 if (trace instanceof TmfTraceStub2) {
38 return true;
39 }
40 return false;
41 }
42
43 @Override
44 public boolean canExecute(ITmfTrace trace) {
45 return appliesTo(trace);
46 }
47
48 @Override
49 public Object execute(ITmfTrace trace, @Nullable TmfTimeRange range, String extraParams, @Nullable IProgressMonitor monitor) {
50 /* Do nothing */
51 return new Object();
52 }
53 }
This page took 0.032894 seconds and 4 git commands to generate.