]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/undo/UndoStack.java
bca92b11119114e930bd28a95785e2cc1cff2130
[GpsPrune.git] / tim / prune / undo / UndoStack.java
1 package tim.prune.undo;
2
3 import java.util.Stack;
4
5 /**
6  * Stack of undo operations
7  * which also remembers how many times it's been cleared
8  */
9 public class UndoStack extends Stack<UndoOperation>
10 {
11         private int _numTimesDeleted = 0;
12
13         /** @return number of times this stack has been deleted */
14         public int getNumTimesDeleted() {
15                 return _numTimesDeleted;
16         }
17
18         @Override
19         public void clear()
20         {
21                 _numTimesDeleted++;
22                 super.clear();
23         }
24 }