1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
package tim.prune;
/**
* Class to remember the current status of the data,
* and make it possible to see whether the data has
* changed in any way since the DataStatus was requested
*/
public class DataStatus
{
private int _undoSize = 0;
private int _deleteCount = 0;
/**
* Constructor
* @param inUndoSize current size of undo stack
* @param inDeleteCount number of times undo stack has been deleted
*/
public DataStatus(int inUndoSize, int inDeleteCount)
{
_undoSize = inUndoSize;
_deleteCount = inDeleteCount;
}
/**
* Has the data changed compared to the previous status?
* @param inPreviousStatus previous status obtained from App
* @return true if the status is now different
*/
public boolean hasDataChanged(DataStatus inPreviousStatus)
{
return _undoSize != inPreviousStatus._undoSize
|| _deleteCount != inPreviousStatus._deleteCount;
}
}
|