org.semwebcentral.sweetrules.infrastructure
Class SweetVersionNumber

java.lang.Object
  extended byorg.semwebcentral.sweetrules.infrastructure.SweetVersionNumber
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, ISweetCanonicalVersionNumber

public class SweetVersionNumber
extends java.lang.Object
implements ISweetCanonicalVersionNumber

This is a very simple initial implementation of a version number Since it extends Comparable any implementation should implement compareTo

TODO: 1) Handle the incoming version number more intelligently both in ctor and set api

Author:
Shashidhara K Ganjugunte, Dr. Benjamin Grosof, Dr. Said Tabet, Chitravanu Neogy

Field Summary
private  Logger logger
           
private  java.math.BigDecimal versionNumber
          The version number stored as a big decimal number
 
Constructor Summary
SweetVersionNumber(java.lang.Object versionNumber)
          Constructor to set version number
 
Method Summary
 java.lang.Object clone()
          The clone method to clone this object
 int compareTo(java.lang.Object o)
          compareTo implementation for the Comparable inteface
 java.lang.Object getNativeVersionNumber()
          Retrieves the version number in the native format
 void print()
          The print method to print the version number
 void setNativeVersionNumber(java.lang.Object versionNumber)
          Set the full version number including the major and the minor versions if any.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionNumber

private java.math.BigDecimal versionNumber
The version number stored as a big decimal number


logger

private Logger logger
Constructor Detail

SweetVersionNumber

public SweetVersionNumber(java.lang.Object versionNumber)
Constructor to set version number

Parameters:
versionNumber - The version number to be stored
Method Detail

setNativeVersionNumber

public void setNativeVersionNumber(java.lang.Object versionNumber)
Set the full version number including the major and the minor versions if any. The version number can be any object such as Integer, String etc which may or may not have an implementation of Comparable

Specified by:
setNativeVersionNumber in interface ISweetCanonicalVersionNumber
Parameters:
versionNumber - The version number in the native format

getNativeVersionNumber

public java.lang.Object getNativeVersionNumber()
Retrieves the version number in the native format

Specified by:
getNativeVersionNumber in interface ISweetCanonicalVersionNumber
Returns:
The version number in the native format

compareTo

public int compareTo(java.lang.Object o)
compareTo implementation for the Comparable inteface

Specified by:
compareTo in interface java.lang.Comparable

print

public void print()
Description copied from interface: ISweetCanonicalVersionNumber
The print method to print the version number

Specified by:
print in interface ISweetCanonicalVersionNumber

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
The clone method to clone this object

Specified by:
clone in interface ISweetCanonicalVersionNumber
Returns:
The cloned object
Throws:
java.lang.CloneNotSupportedException - if an error occurs