org.xnap.util
Class VersionParser

java.lang.Object
  extended by org.xnap.util.VersionParser
All Implemented Interfaces:
java.lang.Comparable

public class VersionParser
extends java.lang.Object
implements java.lang.Comparable

This class can parse an XNap version string.


Constructor Summary
VersionParser(java.lang.String version)
          Constructs a new version parser that parses version.
 
Method Summary
static int compare(java.lang.String v1, java.lang.String v2)
          Compares version v1 with version v2.
 int compareTo(java.lang.Object o)
          Compares this VersionParser to o.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionParser

public VersionParser(java.lang.String version)
Constructs a new version parser that parses version.

Method Detail

compare

public static int compare(java.lang.String v1,
                          java.lang.String v2)
Compares version v1 with version v2.

Returns:
1, if v1 is more recent; 0, if v1 is equal to v2; -1, if v2 is more recent
See Also:
compareTo(Object)

compareTo

public int compareTo(java.lang.Object o)
Compares this VersionParser to o.

Specified by:
compareTo in interface java.lang.Comparable
Returns:
1, if v1 is more recent; 0, if v1 is equal to v2; -1, if v2 is more recent

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2005 XNap Team. All Rights Reserved.