org.ggf.drmaa
Class Version

java.lang.Object
  extended byorg.ggf.drmaa.Version
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

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

This class is used to represent the DRM version info.

Since:
0.5
Version:
1.0
Author:
dan.templeton@sun.com
See Also:
Serialized Form

Constructor Summary
Version(int major, int minor)
          Create a new Version instance
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this object.
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object obj)
          Test for equality between two Version objects.
 int getMajor()
          Get the major version number.
 int getMinor()
          Get the minor version number.
 int hashCode()
          Get a hash code based on the major and minor version numbers.
 java.lang.String toString()
          Converts this Version object into a printable String.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(int major,
               int minor)
Create a new Version instance

Parameters:
major - major version number (non-negative integer)
minor - minor version number (non-negative integer)
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>.

Returns:
a printable String of the format <major>.<minor>

equals

public boolean equals(java.lang.Object obj)
Test for equality between two Version objects.

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.

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:
compareTo in interface java.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.


The contents of this file are licensed under the Sun Industry Standards Source License version 1.2.
Copyright 2007, Sun Microsystems, Inc.