Merge branch 'master' into lttng-luna
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / analysis / TmfAbstractAnalysisParamProvider.java
1 /*******************************************************************************
2 * Copyright (c) 2013 École Polytechnique de Montréal
3 *
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
8 *
9 * Contributors:
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.analysis;
14
15 /**
16 * Abstract class for parameter providers, implements methods and
17 * functionalities to warn the analysis module of parameter changed
18 *
19 * @author Geneviève Bastien
20 * @since 3.0
21 */
22 public abstract class TmfAbstractAnalysisParamProvider implements IAnalysisParameterProvider {
23
24 /**
25 * The module registered with this provider
26 */
27 private IAnalysisModule fModule;
28
29 @Override
30 public void registerModule(IAnalysisModule module) {
31 if (module == null) {
32 throw new IllegalArgumentException();
33 }
34 fModule = module;
35 }
36
37 /**
38 * Gets the analysis module
39 *
40 * @return the {@link IAnalysisModule} associated with this provider
41 */
42 protected IAnalysisModule getModule() {
43 return fModule;
44 }
45
46 /**
47 * Notify the registered module that the said parameter has a new value. The
48 * analysis module will decide what to do with this information
49 *
50 * @param name
51 * Name of the modified parameter
52 */
53 protected void notifyParameterChanged(String name) {
54 if (fModule != null) {
55 fModule.notifyParameterChanged(name);
56 }
57 }
58 }
This page took 0.035338 seconds and 6 git commands to generate.