org.sadun.util
Class VersionImpl

java.lang.Object
  extended byorg.sadun.util.VersionImpl
All Implemented Interfaces:
Version
Direct Known Subclasses:
Version

public class VersionImpl
extends java.lang.Object
implements Version

A simple implementation of Version.

Version:
1.0
Author:
Cristiano Sadun

Field Summary
protected  long buildNumber
           
protected  long buildTimeStamp
           
protected  int major
           
protected  int micro
           
protected  int minor
           
protected  java.lang.String quality
           
 
Fields inherited from interface org.sadun.util.Version
NOT_VALUED
 
Constructor Summary
VersionImpl(int major, int minor, int micro)
           
VersionImpl(int major, int minor, int micro, long buildNumber)
           
VersionImpl(int major, int minor, int micro, long buildNumber, long buildTimeStamp)
           
VersionImpl(int major, int minor, int micro, java.lang.String quality)
           
VersionImpl(int major, int minor, int micro, java.lang.String quality, long buildNumber)
           
VersionImpl(int major, int minor, int micro, java.lang.String quality, long buildNumber, long buildTimeStamp)
           
VersionImpl(int major, int minor, int micro, java.lang.String quality, long buildNumber, java.lang.String buildTimeStamp)
           
VersionImpl(int major, int minor, int micro, java.lang.String quality, long buildNumber, java.lang.String buildTimeStamp, java.util.Locale locale)
           
VersionImpl(int major, int minor, long buildNumber)
           
 
Method Summary
 long getBuildNumber()
          Return the build number, or NOT_VALUED if there is no such number.
 long getBuildTimestamp()
          Return the build timestamp, or NOT_VALUED if there is no such timestamp.
 long getBuildTimeStamp()
           
 java.lang.String getFullDescription()
          Return a full description of the version.
 int getMajor()
           
 int getMajorNumber()
          Return the major version number, or NOT_VALUED if there is no such number.
 int getMicro()
           
 int getMicroNumber()
          Return the micro version number, or NOT_VALUED if there is no such number.
 int getMinor()
           
 int getMinorNumber()
          Return the minor version number, or NOT_VALUED if there is no such number.
 java.lang.String getQuality()
           
 java.lang.String getQualityState()
          Return the quality state string, or null if none is set.
 java.lang.String getShortDescription()
          Return a short description of the version.
 boolean hasInfoEnough()
          Return true if the object contains information enough to be externally meaningful.
 void setBuildNumber(long buildNumber)
           
 void setBuildTimeStamp(long buildTimeStamp)
           
 void setMajor(int major)
           
 void setMicro(int micro)
           
 void setMinor(int minor)
           
 void setQuality(java.lang.String quality)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

major

protected int major

minor

protected int minor

micro

protected int micro

quality

protected java.lang.String quality

buildNumber

protected long buildNumber

buildTimeStamp

protected long buildTimeStamp
Constructor Detail

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro,
                   java.lang.String quality,
                   long buildNumber,
                   long buildTimeStamp)

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro,
                   long buildNumber,
                   long buildTimeStamp)

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro,
                   long buildNumber)

VersionImpl

public VersionImpl(int major,
                   int minor,
                   long buildNumber)

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro,
                   java.lang.String quality,
                   long buildNumber)

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro,
                   java.lang.String quality)

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro)

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro,
                   java.lang.String quality,
                   long buildNumber,
                   java.lang.String buildTimeStamp,
                   java.util.Locale locale)
            throws java.text.ParseException

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro,
                   java.lang.String quality,
                   long buildNumber,
                   java.lang.String buildTimeStamp)
            throws java.text.ParseException
Method Detail

getMajorNumber

public int getMajorNumber()
Description copied from interface: Version
Return the major version number, or NOT_VALUED if there is no such number.

Specified by:
getMajorNumber in interface Version
Returns:
the major version number, or NOT_VALUED if there is no such number.

getMinorNumber

public int getMinorNumber()
Description copied from interface: Version
Return the minor version number, or NOT_VALUED if there is no such number.

Specified by:
getMinorNumber in interface Version
Returns:
the minor version number, or NOT_VALUED if there is no such number.

getMicroNumber

public int getMicroNumber()
Description copied from interface: Version
Return the micro version number, or NOT_VALUED if there is no such number.

Specified by:
getMicroNumber in interface Version
Returns:
the micro version number, or NOT_VALUED if there is no such number.

getQualityState

public java.lang.String getQualityState()
Description copied from interface: Version
Return the quality state string, or null if none is set.

Specified by:
getQualityState in interface Version
Returns:
the quality state string, or null if none is set.

getBuildNumber

public long getBuildNumber()
Description copied from interface: Version
Return the build number, or NOT_VALUED if there is no such number.

Specified by:
getBuildNumber in interface Version
Returns:
the build number, or NOT_VALUED if there is no such number.

getBuildTimestamp

public long getBuildTimestamp()
Description copied from interface: Version
Return the build timestamp, or NOT_VALUED if there is no such timestamp.

Specified by:
getBuildTimestamp in interface Version
Returns:
the build timestamp, or NOT_VALUED if there is no such timestamp.

getShortDescription

public java.lang.String getShortDescription()
Description copied from interface: Version
Return a short description of the version. This is typically limited to major.micro number.

Specified by:
getShortDescription in interface Version
Returns:
a short description of the version. This is typically limited to major.micro number.

getFullDescription

public java.lang.String getFullDescription()
Description copied from interface: Version
Return a full description of the version.

Specified by:
getFullDescription in interface Version
Returns:
a full description of the version.

hasInfoEnough

public boolean hasInfoEnough()
Return true if the object contains information enough to be externally meaningful.

Returns:
true if the object contains information enough to be externally meaningful.

getBuildTimeStamp

public long getBuildTimeStamp()

setBuildTimeStamp

public void setBuildTimeStamp(long buildTimeStamp)

getMajor

public int getMajor()

setMajor

public void setMajor(int major)

getMicro

public int getMicro()

setMicro

public void setMicro(int micro)

getMinor

public int getMinor()

setMinor

public void setMinor(int minor)

getQuality

public java.lang.String getQuality()

setQuality

public void setQuality(java.lang.String quality)

setBuildNumber

public void setBuildNumber(long buildNumber)