ilog.views.appframe.plugin
Class IlvPluginVersion

java.lang.Object
  extended by ilog.views.appframe.plugin.IlvPluginVersion

public final class IlvPluginVersion
extends Object

Defines versions for plugins. IlvPluginVersion objects are automatically instantiated when the plugin manager parses the plugin.xml manifest file of plugins. Versions appear in two places in the manifest file:

A version is composed of four components:

In a string representation, components are specified in the order Major, Minor, Service and Qualifier and are separated with a decimal point. Here are some examples of valid string version representations:

Incorrect specifications of versions in the manifest file of plugins produce IlvPluginException errors with the ID IlvPluginException.BAD_VERSION_ID_ERROR.


Constructor Summary
IlvPluginVersion(String version)
          Constructs a plug-in version from the specified string.
 
Method Summary
 boolean equals(Object object)
          Determines whether this version equals the specified object
 int getMajorComponent()
          Returns the major component of this version identifier.
 int getMinorComponent()
          Returns the minor component of this version identifier.
 String getQualifierComponent()
          Returns the qualifier component of this version.
 int getServiceComponent()
          Returns the service component of this version.
 int hashCode()
          Returns a hash code value for the object.
 boolean isCompatibleWith(IlvPluginVersion id)
          Compares two version identifiers for compatibility.
 boolean isEquivalentTo(IlvPluginVersion id)
          Compares two version identifiers for equivalency.
 boolean isGreaterOrEqualTo(IlvPluginVersion version)
          Determines whether this version is greater or equal than the specified version.
 boolean isGreaterThan(IlvPluginVersion id)
          Compares two version identifiers for order using multi-decimal comparison.
 boolean isPerfect(IlvPluginVersion id)
          Compares two version identifiers for perfect equality.
 String toString()
          Returns the string representation of this version identifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvPluginVersion

public IlvPluginVersion(String version)
                 throws Exception
Constructs a plug-in version from the specified string. See the documentation of the IlvPluginVersion class for more details on the format of this string.

Parameters:
version - The string representation of the version.
Throws:
Exception - An exception is thrown if the specified string version does not have a valid version format.
Method Detail

equals

public boolean equals(Object object)
Determines whether this version equals the specified object

Overrides:
equals in class Object
Parameters:
object - The object to compare.
Returns:
true if this version equal the specified object. Otherwise, this method returns false.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class Object
Returns:
An integer which is a hash code value for this object.

getMajorComponent

public int getMajorComponent()
Returns the major component of this version identifier.


getMinorComponent

public int getMinorComponent()
Returns the minor component of this version identifier.


getServiceComponent

public int getServiceComponent()
Returns the service component of this version.


getQualifierComponent

public String getQualifierComponent()
Returns the qualifier component of this version.


isGreaterOrEqualTo

public boolean isGreaterOrEqualTo(IlvPluginVersion version)
Determines whether this version is greater or equal than the specified version.

A version identifier is considered to be greater than or equal if its major component is greater than the argument major component, or the major components are equal and its minor component is greater than the argument minor component, or the major and minor components are equal and its service component is greater than the argument service component, or the major, minor and service components are equal and the qualifier component is greater than the argument qualifier component (using lexicographic string comparison), or all components are equal.

Parameters:
version - The version to compare this version with.
Returns:
true is this version is greater or equal than the specified version. Otherwise, this method returns false.

isCompatibleWith

public boolean isCompatibleWith(IlvPluginVersion id)
Compares two version identifiers for compatibility.

A version identifier is considered to be compatible if its major component equals to the argument major component, and its minor component is greater than or equal to the argument minor component. If the minor components are equal, than the service level of the version identifier must be greater than or equal to the service level of the argument identifier. If the service levels are equal, the two version identifiers are considered to be equivalent if this qualifier is greater or equal to the qualifier of the argument (using lexicographic string comparison).

Parameters:
id - the other version identifier
Returns:
true is this version identifier is compatible with the given version identifier, and false otherwise

isEquivalentTo

public boolean isEquivalentTo(IlvPluginVersion id)
Compares two version identifiers for equivalency.

Two version identifiers are considered to be equivalent if their major and minor component equal and are at least at the same service level as the argument. If the service levels are equal, the two version identifiers are considered to be equivalent if this qualifier is greater or equal to the qualifier of the argument (using lexicographic string comparison).

Parameters:
id - the other version identifier
Returns:
true is this version identifier is equivalent to the given version identifier, and false otherwise

isPerfect

public boolean isPerfect(IlvPluginVersion id)
Compares two version identifiers for perfect equality.

Two version identifiers are considered to be perfectly equal if their major, minor, service and qualifier components are equal

Parameters:
id - the other version identifier
Returns:
true is this version identifier is perfectly equal to the given version identifier, and false otherwise
Since:
2.0

isGreaterThan

public boolean isGreaterThan(IlvPluginVersion id)
Compares two version identifiers for order using multi-decimal comparison.

Parameters:
id - the other version identifier
Returns:
true is this version identifier is greater than the given version identifier, and false otherwise

toString

public String toString()
Returns the string representation of this version identifier. The result satisfies vi.equals(new IlvPluginVersion(vi.toString())).

Overrides:
toString in class Object
Returns:
the string representation of this plug-in version identifier


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.