ice.util
Class AbstractVersion

java.lang.Object
  extended byice.util.AbstractVersion
All Implemented Interfaces:
Comparable
Direct Known Subclasses:
JavaVersion

public abstract class AbstractVersion
extends Object
implements Comparable

This class provides a versioning framework for subsystems requiring versioning that can be represented by an array (of any length) of integers.


Field Summary
protected  int[] _versionParts
          The various parts of the version spec.
 
Constructor Summary
protected AbstractVersion(int[] versionSpec)
          Constructor referenced by subclasses, passing the concrete version specification
 
Method Summary
 int compareTo(Object obj)
          Implement the compareTo method, this provides a full length comparison.
 int[] getParts()
          Retrieve the individual parts of the internal Version representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_versionParts

protected int[] _versionParts
The various parts of the version spec.

Constructor Detail

AbstractVersion

protected AbstractVersion(int[] versionSpec)
Constructor referenced by subclasses, passing the concrete version specification

Parameters:
versionSpec -
Method Detail

getParts

public int[] getParts()
Retrieve the individual parts of the internal Version representation. Mainly used by custom comparitors, but may be accessed by the public as well.

Returns:
a copy of the internal version parts.

compareTo

public int compareTo(Object obj)
Implement the compareTo method, this provides a full length comparison.

Specified by:
compareTo in interface Comparable
Parameters:
obj - The other array
Returns:
-X, 0, +X if the argument is less than, equal to, or greater than this instance
Throws:
ClassCastException - if the other object is not an instance of AbstractVersion
ArrayIndexOutOfBoundsException - if the other object is an AbstractVersion constructed with a different size