Example #1
0
 public static void addRecord() {
   byte[] bytes = SaverAndLoader.saveStateToMem();
   if (currentState == null) {
     currentState = new State(bytes);
     head.next = currentState;
     tail.prev = currentState;
     currentState.prev = head;
     currentState.next = tail;
   } else {
     State newState = new State(bytes);
     currentState.next = newState;
     tail.prev = newState;
     newState.prev = currentState;
     newState.next = tail;
     currentState = newState;
   }
 }
Example #2
0
 public static void clear() {
   head.next = tail;
   tail.prev = head;
   currentState = null;
 }
Example #3
0
 static {
   head = new State(null);
   tail = new State(null);
   head.next = tail;
   tail.prev = head;
 }