binaryFileStorage
Class BinaryObjectData

java.lang.Object
  extended by binaryFileStorage.BinaryObjectData

public class BinaryObjectData
extends java.lang.Object

Class to temporarily hold an objected data that has just been read from a binary file. Not all types of object use all the fields and data don't tend to stay in this class for long - it's just a convenient wasy of getting data from a to b.

Author:
Doug Gillespie

Field Summary
private  byte[] data
          Binary data - in whatever format
private  int dataLength
          Length of data (often data.length)
private  int objectNumber
          Number of the object within the file
private  int objectType
          Object type (-1 to -4 for main headers and footers, > 0 for proprietary data formats for data objects)
private  long timeMillis
          Object time - for data (not in headers and footers)
private  int versionNumber
          Version number from the moduleHeader - not the main pgdf version number or format but something more module specific.
 
Constructor Summary
BinaryObjectData(int objectType, byte[] data, int dataLength)
           
BinaryObjectData(int objectType, long timeMillis, int objectNumber, byte[] data, int dataLength)
           
 
Method Summary
 byte[] getData()
           
 int getDataLength()
           
 int getObjectNumber()
           
 int getObjectType()
           
 long getTimeMillis()
           
 int getVersionNumber()
           
 void setVersionNumber(int versionNumber)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

objectType

private int objectType
Object type (-1 to -4 for main headers and footers, > 0 for proprietary data formats for data objects)


timeMillis

private long timeMillis
Object time - for data (not in headers and footers)


data

private byte[] data
Binary data - in whatever format


dataLength

private int dataLength
Length of data (often data.length)


objectNumber

private int objectNumber
Number of the object within the file


versionNumber

private int versionNumber
Version number from the moduleHeader - not the main pgdf version number or format but something more module specific.

Constructor Detail

BinaryObjectData

public BinaryObjectData(int objectType,
                        byte[] data,
                        int dataLength)

BinaryObjectData

public BinaryObjectData(int objectType,
                        long timeMillis,
                        int objectNumber,
                        byte[] data,
                        int dataLength)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getObjectType

public int getObjectType()
Returns:
the objectType

getTimeMillis

public long getTimeMillis()
Returns:
the timeMillis

getData

public byte[] getData()
Returns:
the data. Note that the data array may be longer than the actual data within it. Use getDataLength() to check.

getDataLength

public int getDataLength()
Returns:
the dataLength

getObjectNumber

public int getObjectNumber()
Returns:
the objectNumber

getVersionNumber

public int getVersionNumber()
Returns:
the versionNumber

setVersionNumber

public void setVersionNumber(int versionNumber)
Parameters:
versionNumber - the versionNumber to set