Class PackageVersion

  • All Implemented Interfaces:

    public class PackageVersion
    extends java.lang.Object
    implements java.lang.Comparable<PackageVersion>
    A class to represent an XSLT package version such as 1.12.5 or 3.0-alpha

    This implements the semantics given in, where a series of dot-separated integers may be followed optionally by '-'NCName

    • Constructor Detail

      • PackageVersion

        public PackageVersion​(int[] values)
        Return a package version defined by a fixed sequence of int values, which implies no suffix
        values - the sequence of integer components
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Returns a hash code value for the object.
        hashCode in class java.lang.Object
        a hash code value for this object.
      • equalsIgnoringSuffix

        public boolean equalsIgnoringSuffix​(PackageVersion other)
        Compare two version numbers for equality, ignoring the suffix part of the version number. For example 2.1-alpha compares equal to 2.1-beta
        other - the other name/version pair
        true if the values are equal in all respects other than the alphanumeric suffix of the version number.
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • isPrefix

        public boolean isPrefix​(PackageVersion v)
        Tests whether this package version is a prefix (i.e. shares all its components in order) of another package version, and thus this version.* should match it.
        v - The version to be checked that it is equal, or 'extends' this version
        true if this is a prefix, false if not.