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 ListDiffVisitor

java.lang.Object
  extended by 
org.eclipse.core.databinding.observable.list.ListDiffVisitor

public abstract class ListDiffVisitor
extends Object

A visitor for processing differences in a ListDiff.

Since:
1.1
See Also:
ListDiff.accept(ListDiffVisitor)

Constructor Summary
ListDiffVisitor ()
           
 
Method Summary
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.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListDiffVisitor

public ListDiffVisitor()
Method Detail

handleAdd

public abstract void handleAdd(int index,
                               
Object element)
Notifies the visitor that element was added to the list at position index.

Parameters:
index - the index where the element was added
element - the element that was added

handleRemove

public abstract void handleRemove(int index,
                                  
Object element)
Notifies the visitor that element was removed from the list at position index.

Parameters:
index - the index where the element was removed
element - the element that was removed

handleMove

public void handleMove(int oldIndex,
                       int newIndex,
                       
Object element)
Notifies the visitor that 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.

Parameters:
oldIndex - the index that the element was moved from.
newIndex - the index that the element was moved to.
element - the element that was moved
See Also:
IObservableList.move(int, int)

handleReplace

public void handleReplace(int index,
                          
Object oldElement,
                          
Object newElement)
Notifies the visitor that 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.

Parameters:
index - the index where the element was replaced.
oldElement - the element being replaced.
newElement - the element that replaced oldElement.
See Also:
List.set(int, Object)

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