jSyncManager

org.jSyncManager.API.Protocol.Util
Class DLPVersion

java.lang.Object
  |
  +--org.jSyncManager.API.Protocol.Util.DLPVersion
All Implemented Interfaces:
java.io.Serializable

public class DLPVersion
extends java.lang.Object
implements java.io.Serializable

A class for handling DLP's Version information block format. This class holds version information, and can convert to and from DLP version information and Java primitive types. The Palm uses a four byte format for storing version information in a [major version].[minor version] format.

Version:
$Revision: 1.6 $
Author:
Brad BARCLAY <bbarclay@jsyncmanager.org>
Last modified by: $Author: yaztromo $ on $Date: 2003/05/02 03:28:41 $.
See Also:
Serialized Form

Constructor Summary
(package private) DLPVersion()
          Construct a new DLPVersion object as version "1.0".
  DLPVersion(int major, int minor)
          Construct a new DLPVersion object using the specified version information.
 
Method Summary
 int getMajorVersion()
          Retreives the major version number.
 int getMinorVersion()
          Retreives the minor version number.
 float getVersion()
          Get the version number as a float.
 void setMajorVersion(int major)
          Set the major version number.
 void setMinorVersion(int i)
          Set the minor version number.
 java.lang.String toString()
          Convert this version information to human-readable text.
 byte[] versionAsBytes()
          Convert this version object to a series of DLP version bytes.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DLPVersion

DLPVersion()
Construct a new DLPVersion object as version "1.0".

DLPVersion

public DLPVersion(int major,
                  int minor)
Construct a new DLPVersion object using the specified version information.
Parameters:
major - the major version number.
minor - the minor version number.
Method Detail

getMajorVersion

public int getMajorVersion()
Retreives the major version number.
Returns:
the major version number.

getMinorVersion

public int getMinorVersion()
Retreives the minor version number.
Returns:
the minor version number.

getVersion

public float getVersion()
Get the version number as a float.
Returns:
the version number as a float.

setMajorVersion

public void setMajorVersion(int major)
Set the major version number.
Parameters:
major - the major version number.

setMinorVersion

public void setMinorVersion(int i)
Set the minor version number.
Parameters:
minor - the major version number.

toString

public java.lang.String toString()
Convert this version information to human-readable text.
Overrides:
toString in class java.lang.Object
Returns:
a human-readable String representing this object.

versionAsBytes

public byte[] versionAsBytes()
Convert this version object to a series of DLP version bytes.
Returns:
the byte representation of this object.

jSyncManager

Copyright (c) 1999 - 2003 Brad BARCLAY and others. All Rights Reserved.