PamguardMVC
Class SaveRequirements

java.lang.Object
  extended by PamguardMVC.SaveRequirements

public class SaveRequirements
extends java.lang.Object

Class which can tell a data store what type of work is needed to re-save the data.

Author:
Doug Gillespie

Field Summary
protected  int[] deleteIndexes
           
protected  long firstDeleteIndex
           
protected  long firstDeleteTime
           
protected  long firstUpdateIndex
           
protected  long firstUpdateTime
           
protected  long lastDeleteIndex
           
protected  long lastDeleteTime
           
protected  long lastUpdateIndex
           
protected  long lastUpdateTime
           
protected  int numAdditions
           
protected  int numUpdates
           
private  PamDataBlock pamDataBlock
           
protected  int[] updatedIndexes
           
 
Constructor Summary
SaveRequirements(PamDataBlock pamDataBlock)
           
 
Method Summary
 void addDeletedUnit(PamDataUnit aUnit)
          Add a deleted unit
 void addDeleteIndexes(int deleteIndex)
           
 void addUpdateUnit(PamDataUnit aUnit)
          Add an update unit
 int[] getDeleteIndexes()
           
 long getFirstDeleteIndex()
           
 long getFirstDeleteTime()
           
 long getFirstUpdateIndex()
           
 long getFirstUpdateTime()
           
 long getLastDeleteIndex()
           
 long getLastDeleteTime()
           
 long getLastUpdateIndex()
           
 long getLastUpdateTime()
           
 int getNumAdditions()
           
 int getNumDeletions()
           
 int getNumUpdates()
           
 PamDataBlock getPamDataBlock()
           
 int getTotalChanges()
           
 int[] getUpdatedIndexes()
           
 void setFirstDeleteIndex(long firstDeleteIndex)
           
 void setFirstDeleteTime(long firstDeleteTime)
           
 void setFirstUpdateIndex(long firstUpdateIndex)
           
 void setFirstUpdateTime(long firstUpdateTime)
           
 void setLastDeleteIndex(long lastDeleteIndex)
           
 void setLastDeleteTime(long lastDeleteTime)
           
 void setLastUpdateIndex(long lastUpdateIndex)
           
 void setLastUpdateTime(long lastUpdateTime)
           
 void setNumAdditions(int numAdditions)
           
 void setNumUpdates(int numUpdates)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pamDataBlock

private PamDataBlock pamDataBlock

numUpdates

protected int numUpdates

firstUpdateTime

protected long firstUpdateTime

lastUpdateTime

protected long lastUpdateTime

firstUpdateIndex

protected long firstUpdateIndex

lastUpdateIndex

protected long lastUpdateIndex

firstDeleteTime

protected long firstDeleteTime

lastDeleteTime

protected long lastDeleteTime

firstDeleteIndex

protected long firstDeleteIndex

lastDeleteIndex

protected long lastDeleteIndex

numAdditions

protected int numAdditions

deleteIndexes

protected int[] deleteIndexes

updatedIndexes

protected int[] updatedIndexes
Constructor Detail

SaveRequirements

public SaveRequirements(PamDataBlock pamDataBlock)
Method Detail

getTotalChanges

public int getTotalChanges()
Returns:
the total number of changes - additions, updated and deletions.

getNumUpdates

public int getNumUpdates()
Returns:
the numUpdates

setNumUpdates

public void setNumUpdates(int numUpdates)
Parameters:
numUpdates - the numUpdates to set

getFirstUpdateTime

public long getFirstUpdateTime()
Returns:
the firstUpdateTime

setFirstUpdateTime

public void setFirstUpdateTime(long firstUpdateTime)
Parameters:
firstUpdateTime - the firstUpdateTime to set

getLastUpdateTime

public long getLastUpdateTime()
Returns:
the lastUpdateTime

setLastUpdateTime

public void setLastUpdateTime(long lastUpdateTime)
Parameters:
lastUpdateTime - the lastUpdateTime to set

getFirstUpdateIndex

public long getFirstUpdateIndex()
Returns:
the firstUpdateIndex

setFirstUpdateIndex

public void setFirstUpdateIndex(long firstUpdateIndex)
Parameters:
firstUpdateIndex - the firstUpdateIndex to set

getLastUpdateIndex

public long getLastUpdateIndex()
Returns:
the lastUpdateIndex

setLastUpdateIndex

public void setLastUpdateIndex(long lastUpdateIndex)
Parameters:
lastUpdateIndex - the lastUpdateIndex to set

getFirstDeleteTime

public long getFirstDeleteTime()
Returns:
the firstDeleteTime

setFirstDeleteTime

public void setFirstDeleteTime(long firstDeleteTime)
Parameters:
firstDeleteTime - the firstDeleteTime to set

getLastDeleteTime

public long getLastDeleteTime()
Returns:
the lastDeleteTime

setLastDeleteTime

public void setLastDeleteTime(long lastDeleteTime)
Parameters:
lastDeleteTime - the lastDeleteTime to set

getFirstDeleteIndex

public long getFirstDeleteIndex()
Returns:
the firstDeleteIndex

setFirstDeleteIndex

public void setFirstDeleteIndex(long firstDeleteIndex)
Parameters:
firstDeleteIndex - the firstDeleteIndex to set

getLastDeleteIndex

public long getLastDeleteIndex()
Returns:
the lastDeleteIndex

setLastDeleteIndex

public void setLastDeleteIndex(long lastDeleteIndex)
Parameters:
lastDeleteIndex - the lastDeleteIndex to set

getNumAdditions

public int getNumAdditions()
Returns:
the numAdditions

setNumAdditions

public void setNumAdditions(int numAdditions)
Parameters:
numAdditions - the numAdditions to set

getNumDeletions

public int getNumDeletions()
Returns:
the number of items listed for deletion.

getDeleteIndexes

public int[] getDeleteIndexes()
Returns:
the deleteIndexes

addUpdateUnit

public void addUpdateUnit(PamDataUnit aUnit)
Add an update unit

Lists the index and works out the first and last times and indexes.

Parameters:
aUnit -

getUpdatedIndexes

public int[] getUpdatedIndexes()
Returns:
the updatedIndexes - a list of indexes which have been updated.

addDeletedUnit

public void addDeletedUnit(PamDataUnit aUnit)
Add a deleted unit

Lists the index and works out the first and last times and indexes.

Parameters:
aUnit -

addDeleteIndexes

public void addDeleteIndexes(int deleteIndex)
Parameters:
deleteIndexes - add a new index to the delete list

getPamDataBlock

public PamDataBlock getPamDataBlock()
Returns:
the pamDataBlock