File: TooSlowMethod.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 (28 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (2)
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
package tim.prune.function.compress.methods;

import tim.prune.data.NumberUtils;
import tim.prune.function.compress.CompressionMethodType;

public class TooSlowMethod extends SpeedLimitMethod
{
	public TooSlowMethod(String inString) {
		super(recogniseString(inString) ? NumberUtils.getDoubleOrZero(inString.substring(4)) : 0.0, false);
	}

	public TooSlowMethod(double inValue) {
		super(Math.abs(inValue), false);
	}

	public CompressionMethodType getType() {
		return CompressionMethodType.TOO_SLOW;
	}

	@Override
	public String getSettingsString() {
		return getType().getKey() + getSpeedLimit();
	}

	static boolean recogniseString(String inString) {
		return recogniseString(inString, CompressionMethodType.TOO_SLOW);
	}
}