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.jface.viewers.deferred
Class SetModel

java.lang.Object
  extended by 

org.eclipse.jface.viewers.deferred.AbstractConcurrentModel
      extended by 
org.eclipse.jface.viewers.deferred.SetModel
All Implemented Interfaces:
IConcurrentModel

public class SetModel
extends AbstractConcurrentModel

Trivial implementation of an IConcurrentModel. Implements an unordered set of elements that fires off change notifications whenever elements are added or removed from the set. All notifications are sent synchronously.

Since:
3.1

Constructor Summary
SetModel ()
           
 
Method Summary
 void addAll ( Collection toAdd)
          Adds the given elements to the set.
 void addAll ( Object[] toAdd)
          Adds the given elements to the set
 void changeAll ( Object[] changed)
          Fires a change notification for all elements in the given array
 void clear ()
          Empties the set
  Object[] getElements ()
          Return the contents of the model.
 void removeAll ( Object[] toRemove)
          Removes all of the given elements from the set.
 void requestUpdate ( IConcurrentModelListener listener)
          Requests that the receiver to call the given listener's setContents(...)
 void set ( Object[] newContents)
          Sets the contents to the given array of elements
 
Methods inherited from class org.eclipse.jface.viewers.deferred. AbstractConcurrentModel
addListener, fireAdd, fireRemove, fireUpdate, getListeners, removeListener
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetModel

public SetModel()
Method Detail

getElements

public 
Object[] getElements()
Return the contents of the model.

Returns:
the array of elements

set

public void set(
Object[] newContents)
Sets the contents to the given array of elements

Parameters:
newContents - new contents of this set

clear

public void clear()
Empties the set


addAll

public void addAll(
Object[] toAdd)
Adds the given elements to the set

Parameters:
toAdd - elements to add

addAll

public void addAll(
Collection toAdd)
Adds the given elements to the set. Duplicate elements are ignored.

Parameters:
toAdd - elements to add

changeAll

public void changeAll(
Object[] changed)
Fires a change notification for all elements in the given array

Parameters:
changed - array of elements that have changed

removeAll

public void removeAll(
Object[] toRemove)
Removes all of the given elements from the set.

Parameters:
toRemove - elements to remove

requestUpdate

public void requestUpdate(
IConcurrentModelListener listener)
Description copied from interface: IConcurrentModel
Requests that the receiver to call the given listener's setContents(...) method at its earliest convenience. The receiver is allowed to compute the elements asynchronously. That is, it can compute the result in a background thread and call setContents(...) once the result is ready. If the result is too large to return in one batch, it can call setContents with an empty array followed by a sequence of adds.

Has no effect if an update is already queued for an identical listener.

Parameters:
listener - listener whose setContents method should be called. The listener must have been previously registered with addListener.

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