public abstract class ListDiffVisitor extends Object
ListDiff.accept(ListDiffVisitor)
Constructor and Description |
---|
ListDiffVisitor() |
Modifier and Type | Method and Description |
---|---|
abstract void |
handleAdd(int index,
Object element)
Notifies the visitor that
element was added to the list at
position index . |
void |
handleMove(int oldIndex,
int newIndex,
Object element)
Notifies the visitor that
element was moved in the list
from position oldIndex to position newIndex . |
abstract void |
handleRemove(int index,
Object element)
Notifies the visitor that
element was removed from the
list at position index . |
void |
handleReplace(int index,
Object oldElement,
Object newElement)
Notifies the visitor that
oldElement , located at position
index in the list, was replaced by newElement . |
public abstract void handleAdd(int index, Object element)
element
was added to the list at
position index
.index
- the index where the element was addedelement
- the element that was addedpublic abstract void handleRemove(int index, Object element)
element
was removed from the
list at position index
.index
- the index where the element was removedelement
- the element that was removedpublic void handleMove(int oldIndex, int newIndex, Object element)
element
was moved in the list
from position oldIndex
to position newIndex
.
The default implementation of this method calls
handleRemove(int, Object)
with the old position, then
handleAdd(int, Object)
with the new position. Clients which are
interested in recognizing "moves" in a list (i.e. calls to
IObservableList.move(int, int)
) should override this method.
oldIndex
- the index that the element was moved from.newIndex
- the index that the element was moved to.element
- the element that was movedIObservableList.move(int, int)
public void handleReplace(int index, Object oldElement, Object newElement)
oldElement
, located at position
index
in the list, was replaced by newElement
.
The default implementation of this method calls
handleRemove(int, Object)
with the old element, then
handleAdd(int, Object)
with the new element. Clients which are
interested in recognizing "replaces" in a list (i.e. calls to
List.set(int, Object)
) should override this method.
index
- the index where the element was replaced.oldElement
- the element being replaced.newElement
- the element that replaced oldElement.List.set(int, Object)
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.