|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.cmu.cs.coral.icf.plan_based.planners.pip.ListChange
Represents a change to a list.
Field Summary | |
static int |
add
Code for adding an element to the list. |
private int |
addDel
indicates whether the element was added or deleted |
static int |
del
Code for removing an element from the list |
private java.lang.Object |
elem
the element inserted/deleted |
private int |
index
the index of the element inserted/deleted |
private java.util.List |
list
the list that was modified |
Constructor Summary | |
private |
ListChange(int add_del,
java.util.List list,
int index,
java.lang.Object elem)
Constructs a list change of the appopriate type. |
Method Summary | |
void |
make()
Makes the change to the list. |
static ListChange |
makeListChange(int add_del,
java.util.List list,
int index,
java.lang.Object elem)
Performs the designated operation and returns a list change that can be used to undo the operation. |
void |
undo()
Undoes the change to the list. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int add
public static final int del
private int addDel
private java.util.List list
private int index
private java.lang.Object elem
Constructor Detail |
private ListChange(int add_del, java.util.List list, int index, java.lang.Object elem)
add_del
- ListChange.add if the elemented is added to the list,
ListChange.del if the elemented is deleted to the list,list
- the list that is modifiedindex
- the index to use for the element to added/removed from the listelem
- the element that is added/removed from the listMethod Detail |
public void undo()
public void make()
public static ListChange makeListChange(int add_del, java.util.List list, int index, java.lang.Object elem)
add_del
- ListChange.add if the element is added to the list,
ListChange.del if the element is deleted from the list,list
- the list that is modifiedindex
- the index to use for the element to added/removed from the list (ignored for deletions with an element provided, use -1)elem
- the element that is added/removed from the list (for deletion, null to use index to find element). For deletion, the
the first element of the list == to this element will be removed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |