org.jSyncManager.API.Protocol.Util

Class DLPVersion

Implemented Interfaces:
Serializable

public class DLPVersion
extends java.lang.Object
implements 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.

Constructor Summary

DLPVersion(int packedData)
Construct a new DLPVersion object using the specified version information.
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 minor)
Set the minor version number.
String
toString()
Convert this version information to human-readable text.
byte[]
versionAsBytes()
Convert this version object to a series of DLP version bytes.

Constructor Details

DLPVersion

public DLPVersion(int packedData)
Construct a new DLPVersion object using the specified version information.
Parameters:
packedData - an int representing the version.

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 Details

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 minor)
Set the minor version number.
Parameters:
minor - the major version number.

toString

public String toString()
Convert this version information to human-readable text.
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.