binaryFileStorage
Class DataUnitFileInformation

java.lang.Object
  extended by binaryFileStorage.DataUnitFileInformation

public class DataUnitFileInformation
extends java.lang.Object

Little bit of data to add to all PamDataUnits when they are read back from a file which will be used to say which file they were from, whether they need updating, etc.

Author:
Doug Gillespie

Field Summary
private  java.io.File file
          File this data unit was read from
private  long indexInFile
          Objects index in the file.
private  boolean needsUpdate
          Set if the unit has changes offline, in which case the binary file will probably need rewriting
 
Constructor Summary
DataUnitFileInformation(java.io.File file, long indexInFile)
           
 
Method Summary
 java.io.File getFile()
           
 long getIndexInFile()
           
 java.lang.String getShortFileName(int maxChars)
          Get a file name, but shortened to a maximum number of characters.
 boolean isNeedsUpdate()
           
 void setNeedsUpdate(boolean needsUpdate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private java.io.File file
File this data unit was read from


needsUpdate

private boolean needsUpdate
Set if the unit has changes offline, in which case the binary file will probably need rewriting


indexInFile

private long indexInFile
Objects index in the file.

Constructor Detail

DataUnitFileInformation

public DataUnitFileInformation(java.io.File file,
                               long indexInFile)
Method Detail

getShortFileName

public java.lang.String getShortFileName(int maxChars)
Get a file name, but shortened to a maximum number of characters.

Since the most file specific information will always come at the end of the file, the beginning of the name is stripped off and the end left alone.

Parameters:
maxChars - max length of file name to be returned.
Returns:
a shortened file name.

isNeedsUpdate

public boolean isNeedsUpdate()
Returns:
the needsUpdate

setNeedsUpdate

public void setNeedsUpdate(boolean needsUpdate)
Parameters:
needsUpdate - the needsUpdate to set

getFile

public java.io.File getFile()
Returns:
the file

getIndexInFile

public long getIndexInFile()
Returns:
the indexInFile