File: DataStatus.java

package info (click to toggle)
gpsprune 19.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,516 kB
  • sloc: java: 42,704; sh: 25; makefile: 24; python: 15
file content (34 lines) | stat: -rw-r--r-- 850 bytes parent folder | download | duplicates (5)
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 _numUndos = 0;

	/**
	 * Constructor
	 * @param inUndoSize current size of undo stack
	 * @param inNumUndos number of operations undone
	 */
	public DataStatus(int inUndoSize, int inNumUndos)
	{
		_undoSize = inUndoSize;
		_numUndos = inNumUndos;
	}

	/**
	 * 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
			|| _numUndos != inPreviousStatus._numUndos;
	}
}