me.mjolnir.mineconomy.internal.util
Class Version

java.lang.Object
  extended by me.mjolnir.mineconomy.internal.util.Version

public class Version
extends java.lang.Object

Version:
1.0
Author:
Matthew Edwards

Field Summary
static int EQUAL
          Denotes a comparison being equal.
static int NEWER
          Denotes a comparison being newer.
static int OLDER
          Denotes a comparison being older.
 
Constructor Summary
Version()
          Creates new Version object.
Version(java.lang.String s)
          Creates new Version object using a String.
Version(Version v)
          Creates new Version object using an existing Version object.
 
Method Summary
 java.lang.Object clone()
           
 int compare(Version v)
          Compares this Version to Version.
static int compare(Version v1, Version v2)
          Compares Version 1 to Version 2.
 boolean equals(java.lang.Object obj)
           
 boolean isNewer(Version v)
          Returns true if this Version is newer than Version.
static boolean isNewer(Version v, Version v2)
          Returns true if Version is newer than Version 2.
 boolean isVersion(java.lang.String s)
          Returns true if String can be converted to a Version.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EQUAL

public static final int EQUAL
Denotes a comparison being equal.

See Also:
Constant Field Values

NEWER

public static final int NEWER
Denotes a comparison being newer.

See Also:
Constant Field Values

OLDER

public static final int OLDER
Denotes a comparison being older.

See Also:
Constant Field Values
Constructor Detail

Version

public Version()
Creates new Version object.


Version

public Version(java.lang.String s)
Creates new Version object using a String.

Parameters:
s -

Version

public Version(Version v)
Creates new Version object using an existing Version object.

Parameters:
v -
Method Detail

isVersion

public boolean isVersion(java.lang.String s)
Returns true if String can be converted to a Version.

Parameters:
s -
Returns:
True if String can be converted to a Version.

compare

public int compare(Version v)
Compares this Version to Version.

Parameters:
v -
Returns:
0, 1, or 2 based on EQUAL, NEWER, or OLDER

compare

public static int compare(Version v1,
                          Version v2)
Compares Version 1 to Version 2.

Parameters:
v1 -
v2 -
Returns:
0, 1, or 2 based on EQUAL, NEWER, or OLDER

isNewer

public boolean isNewer(Version v)
Returns true if this Version is newer than Version.

Parameters:
v -
Returns:
True if this Version is newer than Version.

isNewer

public static boolean isNewer(Version v,
                              Version v2)
Returns true if Version is newer than Version 2.

Parameters:
v -
v2 -
Returns:
True if this Version is newer than Version.

toString

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

equals

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

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object