Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

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

java.lang.Object
  extended by 
org.eclipse.core.databinding.observable.list.ListDiff
All Implemented Interfaces:
IDiff

public abstract class ListDiff
extends Object
implements IDiff

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.
 void applyTo ( List list)
          Applies the changes in this diff to the given list
abstract   ListDiffEntry[] getDifferences ()
          Returns a ListDiffEntry array representing the differences in the list, in the order they are to be processed.
 boolean isEmpty ()
          Returns true if the diff contains no added, removed, moved or replaced elements.
  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 an add entry is adjacent to a remove entry, and both entries operate on the same location in the list.
  2. ListDiffVisitor.handleMove(int, int, Object) is called whenever an add entry is adjacent to a remove entry, and both entries have equivalent elements.
  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

isEmpty

public boolean isEmpty()
Returns true if the diff contains no added, removed, moved or replaced elements.

Returns:
true if the diff contains no added, removed, moved or replaced elements.
Since:
1.2

applyTo

public void applyTo(
List list)
Applies the changes in this diff to the given list

Parameters:
list - the list to which the diff will be applied
Since:
1.2

toString

public 
String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

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


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire