Mobile Tools for Java
Release 1.0

org.eclipse.mtj.core.model
Class Version

java.lang.Object
  extended by org.eclipse.mtj.core.model.Version
All Implemented Interfaces:
Comparable<Object>

public class Version
extends Object
implements Comparable<Object>

Represents the version of a component. Understands a string of the form "major.minor.secondary_patch".

Note: This class/interface is part of an interim API that is still under development and expected to change before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken as the API evolves.


Constructor Summary
Version(String versionString)
          Construct a new version instance based on the specified version string.
 
Method Summary
 int compareTo(Object o)
           
 int compareTo(Version version)
           
 boolean equals(Object object)
           
 boolean equals(Version version)
          Return a boolean indicating the equality of the specified version to this version.
 String getMajor()
          Get the major version number.
 String getMinor()
          Get the minor version number or null if not specified.
 String getPatch()
          Get the patch version number or null if not specified.
 String getSecondary()
          Get the secondary version number or null if not specified.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(String versionString)
Construct a new version instance based on the specified version string.

Method Detail

compareTo

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

compareTo

public int compareTo(Version version)
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(Object object)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

equals

public boolean equals(Version version)
Return a boolean indicating the equality of the specified version to this version.

Parameters:
version -
Returns:

getMajor

public String getMajor()
Get the major version number.

Returns:
the major version string

getMinor

public String getMinor()
Get the minor version number or null if not specified.

Returns:
the minor version string

getPatch

public String getPatch()
Get the patch version number or null if not specified.

Returns:
the patch version string

getSecondary

public String getSecondary()
Get the secondary version number or null if not specified.

Returns:
the secondary version string.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

Mobile Tools for Java
Release 1.0