games.strategy.util
Class Version

java.lang.Object
  extended by games.strategy.util.Version
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class Version
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

Represents a version string. versions are of the form major.minor.point.micro note that when doing comparisons, if the micro for two versions is the same, then the two versions are considered equal

Author:
Sean Bridges
See Also:
Serialized Form

Constructor Summary
Version(int major, int minor)
           
Version(int major, int minor, int point)
           
Version(int major, int minor, int point, int micro)
           
Version(java.lang.String version)
          version must be of the from xx.xx.xx.xx or xx.xx.xx or xx.xx or xx where xx is a positive integer
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(int major,
               int minor)

Version

public Version(int major,
               int minor,
               int point)

Version

public Version(int major,
               int minor,
               int point,
               int micro)

Version

public Version(java.lang.String version)
version must be of the from xx.xx.xx.xx or xx.xx.xx or xx.xx or xx where xx is a positive integer

Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

toString

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