Package VASSAL.tools.version
Class VassalVersionTokenizer
java.lang.Object
VASSAL.tools.version.VassalVersionTokenizer
- All Implemented Interfaces:
VersionTokenizer
@Deprecated(since="2020-08-28", forRemoval=true) public class VassalVersionTokenizer extends Object implements VersionTokenizer
Deprecated, for removal: This API element is subject to removal in a future version.
A finite-state machine for converting VASSAL version numbers into
a series of integers. The integers thus returned from two different
tokenizers may be compared to determine the temporal ordering of two
VASSAL versions.
Valid version strings are dotted decimal digits, followed optionally
by a tag, followed optionally by a build number. Anything beyond the
build nubmer is ignored.
Old version numbers which are not valid by current standards (e.g., 3.0b6)
may be successfully parsed far enough to determine their ordering with
respect to post-3.1.0 versions.
- Since:
- 3.1.0
- Author:
- Joel Uckelman
- See Also:
VersionFormatException
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classVassalVersionTokenizer.StateDeprecated, for removal: This API element is subject to removal in a future version. -
Field Summary
Fields Modifier and Type Field Description protected VassalVersionTokenizer.StatestateDeprecated, for removal: This API element is subject to removal in a future version.protected static Map<String,Integer>tagsDeprecated, for removal: This API element is subject to removal in a future version.protected StringvDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
Constructors Constructor Description VassalVersionTokenizer(String version)Deprecated, for removal: This API element is subject to removal in a future version.Constructs aVersionTokenizerwhich operates on a versionString. -
Method Summary
Modifier and Type Method Description booleanhasNext()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif the versionStringis not fully parsed.intnext()Deprecated, for removal: This API element is subject to removal in a future version.Returns an integer representing the next token.
-
Field Details
-
v
Deprecated, for removal: This API element is subject to removal in a future version. -
state
Deprecated, for removal: This API element is subject to removal in a future version. -
tags
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
VassalVersionTokenizer
Deprecated, for removal: This API element is subject to removal in a future version.Constructs aVersionTokenizerwhich operates on a versionString.- Parameters:
version- the versionStringto parse- Throws:
IllegalArgumentException- ifversion == null.
-
-
Method Details
-
hasNext
public boolean hasNext()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif the versionStringis not fully parsed.- Specified by:
hasNextin interfaceVersionTokenizer- Returns:
trueifVersionTokenizer.next()will return more integers
-
next
Deprecated, for removal: This API element is subject to removal in a future version.Returns an integer representing the next token.- Specified by:
nextin interfaceVersionTokenizer- Returns:
- the integer representing the next token
- Throws:
VersionFormatException- if the string deviates from the current version formatting rules at the next token.
-