Package org.ggf.drmaa
Class Version
- java.lang.Object
-
- org.ggf.drmaa.Version
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable
public class Version extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, java.lang.ComparableThis class is used to represent the DRM version info.- Since:
- 0.5
- Version:
- 1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Version(int major, int minor)Create a new Version instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a copy of this object.intcompareTo(java.lang.Object o)Compares this object with the specified object for order.booleanequals(java.lang.Object obj)Test for equality between two Version objects.intgetMajor()Get the major version number.intgetMinor()Get the minor version number.inthashCode()Get a hash code based on the major and minor version numbers.java.lang.StringtoString()Converts this Version object into a printable String.
-
-
-
Method Detail
-
getMajor
public int getMajor()
Get the major version number.- Returns:
- major version number (non-negative integer)
-
getMinor
public int getMinor()
Get the minor version number.- Returns:
- minor version number (non-negative integer)
-
toString
public java.lang.String toString()
Converts this Version object into a printable String. The String's format is <major>.<minor>.- Overrides:
toStringin classjava.lang.Object- Returns:
- a printable String of the format <major>.<minor>
-
equals
public boolean equals(java.lang.Object obj)
Test for equality between two Version objects.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object against which to test- Returns:
- whether the given object has the same major and minor version numbers as this object
-
hashCode
public int hashCode()
Get a hash code based on the major and minor version numbers.- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code
-
clone
public java.lang.Object clone()
Returns a copy of this object.- Returns:
- a copy of this object.
-
compareTo
public int compareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
o- the Object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
java.lang.ClassCastException- if the specified object's type prevents it from being compared to this Object.
-
-