maspack.util
Class ListRemove<C>

java.lang.Object
  extended by maspack.util.ListRemove<C>

public class ListRemove<C>
extends java.lang.Object

A utility class to remove items from a list, and (later) return them to the list in the same order. The basic usage model is this:

    List list;
    ...
    ListRemove listRemove = new ListRemove(list);
    for (int i=0; i
 Item to be removed are specified by index. The class attempts
 to preform the remove in O(n) time.


Constructor Summary
ListRemove(java.util.List<C> list)
           
 
Method Summary
 java.util.List<C> getList()
           
 void remove()
           
 void requestRemove(int idx)
           
 void requestRemoveAll(java.util.Collection<java.lang.Integer> idxs)
           
 void undo()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListRemove

public ListRemove(java.util.List<C> list)
Method Detail

getList

public java.util.List<C> getList()

requestRemove

public void requestRemove(int idx)

requestRemoveAll

public void requestRemoveAll(java.util.Collection<java.lang.Integer> idxs)

remove

public void remove()

undo

public void undo()