File: SymbolScaleFactor.java

package info (click to toggle)
gpsprune 26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,824 kB
  • sloc: java: 52,154; sh: 25; makefile: 21; python: 15
file content (18 lines) | stat: -rw-r--r-- 453 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package tim.prune.data;

/**
 * Validation of symbol scale factor to restrict to certain range
 */
public abstract class SymbolScaleFactor
{
	private static final double MIN_FACTOR = 0.1;
	private static final double MAX_FACTOR = 3.0;

	/**
	 * @param inFactor value entered by user
	 * @return validated value within range
	 */
	public static double validateFactor(double inFactor) {
		return Math.min(MAX_FACTOR, Math.max(MIN_FACTOR, inFactor));
	}
}