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