Eclipse Platform
Release 3.4

org.eclipse.core.databinding.observable.list
Class ListDiff

java.lang.Object
  extended byorg.eclipse.core.databinding.observable.list.ListDiff

public abstract class ListDiff
extends Object

Object describing a diff between two lists.

Since:
1.0

Constructor Summary
ListDiff()
           
 
Method Summary
 void accept(ListDiffVisitor visitor)
          Traverses the getDifferences() array, calling the appropriate method in visitor for each difference.
abstract  ListDiffEntry[] getDifferences()
          Returns a ListDiffEntry array representing the differences in the list, in the order they are to be processed.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListDiff

public ListDiff()
Method Detail

getDifferences

public abstract ListDiffEntry[] getDifferences()
Returns a ListDiffEntry array representing the differences in the list, in the order they are to be processed.

Returns:
a ListDiffEntry array representing the differences in the list, in the order they are to be processed.

accept

public void accept(ListDiffVisitor visitor)
Traverses the getDifferences() array, calling the appropriate method in visitor for each difference.
  1. ListDiffVisitor.handleReplace(int, Object, Object) is called whenever a remove entry is immediately followed by an add entry which shares the same list index.
  2. ListDiffVisitor.handleMove(int, int, Object) is called whenever a remove entry is immediately followed by an add entry with an equivalent element.
  3. ListDiffVisitor.handleRemove(int, Object) is called whenever a remove entry does not match conditions 1 or 2.
  4. ListDiffVisitor.handleAdd(int, Object) is called whenever an add entry does not match conditions in 1 or 2.

Parameters:
visitor - the visitor to receive callbacks.
Since:
1.1
See Also:
ListDiffVisitor

toString

public String toString()
See Also:
Object.toString()

Eclipse Platform
Release 3.4

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.