com.bramosystems.oss.player.core.client
Class PluginVersion

java.lang.Object
  extended by com.bramosystems.oss.player.core.client.PluginVersion
All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable, Serializable, Comparable<PluginVersion>

public class PluginVersion
extends Object
implements com.google.gwt.user.client.rpc.IsSerializable, Serializable, Comparable<PluginVersion>

Wraps the major, minor and revision numbers of a browser plugin component.

Author:
Sikirulai Braheem
See Also:
Serialized Form

Constructor Summary
PluginVersion()
          Creates a PluginVersion
PluginVersion(int major, int minor, int revision)
          Creates a PluginVersion with the specified minor, major and revision numbers.
 
Method Summary
 int compareTo(int major, int minor, int revision)
          Convenience method to compare this PluginVersion with a PluginVersion with the specified major, minor and revision numbers.
 int compareTo(PluginVersion o)
          Compares this PluginVersion with the specified PluginVersion.
 boolean equals(Object obj)
          Indicates if some other object is equal to this one.
static PluginVersion get(int major, int minor, int revision)
          Static method to create a PluginVersion with the specified minor, major and revision numbers.
static PluginVersion get(String version)
          Static method to create a PluginVersion with the specified version string.
 int getMajor()
          Gets major version number.
 int getMinor()
          Gets minor version number
 int getRevision()
          Gets the revsion number
 int hashCode()
           
 void setMajor(int major)
          Sets the major version number.
 void setMinor(int minor)
          Sets minor version number
 void setRevision(int revision)
          Sets the revision number of this PluginVersion object
 String toString()
          Returns a String representation of this PluginVersion in the format major.minor.revision.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginVersion

public PluginVersion()
Creates a PluginVersion


PluginVersion

public PluginVersion(int major,
                     int minor,
                     int revision)
Creates a PluginVersion with the specified minor, major and revision numbers.

Parameters:
major - major version number
minor - minor version number
revision - revision number
Method Detail

get

public static PluginVersion get(int major,
                                int minor,
                                int revision)
Static method to create a PluginVersion with the specified minor, major and revision numbers.

Parameters:
major - major version number
minor - minor version number
revision - revision number
Returns:
PluginVersion object with specified version numbers.

get

public static PluginVersion get(String version)
                         throws RegExp.RegexException
Static method to create a PluginVersion with the specified version string.

Parameters:
version - the version in the format major.minor.revision.
Returns:
PluginVersion object with specified version numbers.
Throws:
RegExp.RegexException - if version is not in the required format
Since:
1.3

getMinor

public int getMinor()
Gets minor version number

Returns:
minor version number

setMinor

public void setMinor(int minor)
Sets minor version number

Parameters:
minor -

getMajor

public int getMajor()
Gets major version number.

Returns:
major version number

setMajor

public void setMajor(int major)
Sets the major version number.

Parameters:
major -

getRevision

public int getRevision()
Gets the revsion number

Returns:
revision number

setRevision

public void setRevision(int revision)
Sets the revision number of this PluginVersion object

Parameters:
revision -

equals

public boolean equals(Object obj)
Indicates if some other object is equal to this one. Two PluginVersion's are equal if their major, minor and revision numbers are equal.

Overrides:
equals in class Object
Parameters:
obj - the other PluginVersion object
Returns:
true if and only if obj is same as this object, false otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(PluginVersion o)
Compares this PluginVersion with the specified PluginVersion. Two PluginVersions are the same if they have the same major, minor and revision numbers.

Specified by:
compareTo in interface Comparable<PluginVersion>
Parameters:
o - the PluginVersion to compare with this one.
Returns:
0 if this PluginVersion is the same as the specified PluginVersion, -1 if this PluginVersion is less than the specified PluginVersion and 1 if this PluginVersion is greater than the specified PluginVersion.
See Also:
compareTo(int, int, int)

compareTo

public int compareTo(int major,
                     int minor,
                     int revision)
Convenience method to compare this PluginVersion with a PluginVersion with the specified major, minor and revision numbers.

Parameters:
major - major version number
minor - minor version number
revision - revision number
Returns:
0 if this PluginVersion is the same as the specified PluginVersion, -1 if this PluginVersion is less than the specified PluginVersion and 1 if this PluginVersion is greater than the specified PluginVersion.
See Also:
compareTo(PluginVersion o)

toString

public String toString()
Returns a String representation of this PluginVersion in the format major.minor.revision.

Overrides:
toString in class Object
Returns:
PluginVersion as String format.


Copyright © 2009-2011. All Rights Reserved.