File: SingleNumericParameterFunction.java

package info (click to toggle)
gpsprune 17-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,984 kB
  • ctags: 5,218
  • sloc: java: 39,403; sh: 25; makefile: 17; python: 15
file content (36 lines) | stat: -rw-r--r-- 1,075 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package tim.prune.function;

import tim.prune.App;
import tim.prune.GenericFunction;

/**
 * Abstract superclass of Functions which just take a
 * single numeric parameter
 */
public abstract class SingleNumericParameterFunction extends GenericFunction
{
	/** Minimum and maximum allowed values */
	protected int _minAllowedValue, _maxAllowedValue;

	/** Constructor */
	public SingleNumericParameterFunction(App inApp, int inMinValue, int inMaxValue)
	{
		super(inApp);
		_minAllowedValue = inMinValue;
		_maxAllowedValue = inMaxValue;
	}

	/** Get the current value for display in the dialog */
	public abstract int getCurrentParamValue();

	/** Get the key for the description label */
	public abstract String getDescriptionKey();

	/** Callback to trigger the rest of the function once the parameter has been chosen */
	public abstract void completeFunction(int inParam);

	/** @return minimum allowed value */
	public int getMinAllowedValue() {return _minAllowedValue;}
	/** @return maximum allowed value */
	public int getMaxAllowedValue() {return _maxAllowedValue;}
}