public class PackageVersion
extends java.lang.Object
implements java.lang.Comparable
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(java.lang.Object 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-versionsXPathExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic boolean equalsIgnoringSuffix(PackageVersion other)
other - the other name/version pairpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isPrefix(PackageVersion v)
v - The version to be checked that it is equal, or 'extends' this versionCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.