File: GpxVersion.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 (23 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package tim.prune.save.xml;

/** Represents a version of Gpx */
public enum GpxVersion
{
	GPX_1_0("1/0", "10.xsd"), GPX_1_1("1/1", "11.xsd");

	private final String _idString;
	private final String _altString;

	GpxVersion(String inId, String inAlternative) {
		_idString = inId;
		_altString = "/" + inAlternative;
	}

	/** @return true if the given string matches this version */
	boolean matches(String inString)
	{
		return inString != null
				&& (inString.endsWith(_idString) || inString.contains(_idString + "/")
						|| inString.endsWith(_altString));
	}
}