public class PackageVersion extends java.lang.Object implements java.lang.Comparable<PackageVersion>
This implements the semantics given in http://www.w3.org/TR/xslt-30/#package-versions, where a series of dot-separated integers may be followed optionally by '-'NCName
Modifier and Type | Field and Description |
---|---|
static PackageVersion |
MAX_VALUE |
static PackageVersion |
ONE |
java.util.List<java.lang.Integer> |
parts |
java.lang.String |
suffix |
static PackageVersion |
ZERO |
Constructor and Description |
---|
PackageVersion(int[] values)
Return a package version defined by a fixed sequence of int values, which implies no suffix
|
PackageVersion(java.lang.String s)
Generate a package version from a string description
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PackageVersion o) |
boolean |
equals(java.lang.Object o) |
boolean |
equalsIgnoringSuffix(PackageVersion other)
Compare two version numbers for equality, ignoring the suffix part
of the version number.
|
boolean |
isPrefix(PackageVersion v)
Tests whether this package version is a prefix (i.e.
|
java.lang.String |
toString() |
public java.util.List<java.lang.Integer> parts
public java.lang.String suffix
public static PackageVersion ZERO
public static PackageVersion ONE
public static PackageVersion MAX_VALUE
public PackageVersion(int[] values)
values
- the sequence of integer componentspublic PackageVersion(java.lang.String s) throws XPathException
s
- The input string describing the package version according to the grammar given at:
http://www.w3.org/TR/xslt-30/#package-versionsXPathException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equalsIgnoringSuffix(PackageVersion other)
other
- the other name/version pairpublic int compareTo(PackageVersion o)
compareTo
in interface java.lang.Comparable<PackageVersion>
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isPrefix(PackageVersion v)
v
- The version to be checked that it is equal, or 'extends' this versionCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.