net.i2p.util
Class VersionComparator

java.lang.Object
  extended by net.i2p.util.VersionComparator
All Implemented Interfaces:
java.util.Comparator<java.lang.String>

public class VersionComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.String>

Compares versions. Characters other than [0-9.-_] are ignored. I2P only uses '.' but Sun Java uses '_' and plugins may use any of '.-_' Moved from TrustedUpdate.java

Since:
0.7.10

Constructor Summary
VersionComparator()
           
 
Method Summary
 int compare(java.lang.String l, java.lang.String r)
          l and r non-null
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

VersionComparator

public VersionComparator()
Method Detail

compare

public int compare(java.lang.String l,
                   java.lang.String r)
l and r non-null

Specified by:
compare in interface java.util.Comparator<java.lang.String>

main

public static void main(java.lang.String[] args)