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 class  VassalVersionTokenizer.State
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected VassalVersionTokenizer.State state
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static Map<String,​Integer> tags
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String v
    Deprecated, 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 a VersionTokenizer which operates on a version String.
  • Method Summary

    Modifier and Type Method Description
    boolean hasNext()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if the version String is not fully parsed.
    int next()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an integer representing the next token.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • v

      protected String 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

      protected static Map<String,​Integer> tags
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • VassalVersionTokenizer

      public VassalVersionTokenizer​(String version)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a VersionTokenizer which operates on a version String.
      Parameters:
      version - the version String to parse
      Throws:
      IllegalArgumentException - if version == null.
  • Method Details

    • hasNext

      public boolean hasNext()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if the version String is not fully parsed.
      Specified by:
      hasNext in interface VersionTokenizer
      Returns:
      true if VersionTokenizer.next() will return more integers
    • next

      public int next() throws VersionFormatException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns an integer representing the next token.
      Specified by:
      next in interface VersionTokenizer
      Returns:
      the integer representing the next token
      Throws:
      VersionFormatException - if the string deviates from the current version formatting rules at the next token.