edu.toronto.cs.util
Interface MarkedList

All Superinterfaces:
java.util.Collection, java.lang.Iterable, java.util.List
All Known Implementing Classes:
ArrayMarkedList

public interface MarkedList
extends java.util.List

interface MarkedList is a extention of List that allows to mark a position in the list and to go back to it. Operations like remove (index) and add (index) that may alter the order in the list are not supported . Also no remove operations are suported, only restore.

Version:
1.0
Author:
Anton Selyshchev

Method Summary
 void mark()
          Marks the current state of the list.
 void restore()
          removes the last mark and all the assertions done after the mark.
 void restore(int markNumber)
          if markNumber is the last mark, works like restore () else removes all the asserts done after mark (markNumber +1) together with the mark number (markNumber + 1)
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

mark

void mark()
Marks the current state of the list. This state can be later restored with restore()


restore

void restore()
removes the last mark and all the assertions done after the mark.


restore

void restore(int markNumber)
if markNumber is the last mark, works like restore () else removes all the asserts done after mark (markNumber +1) together with the mark number (markNumber + 1)

Parameters:
markNumber - what to restore the list to.