Class SetModel
java.lang.Object
org.eclipse.jface.viewers.deferred.AbstractConcurrentModel
org.eclipse.jface.viewers.deferred.SetModel
- All Implemented Interfaces:
- IConcurrentModel
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds the given elements to the setvoidaddAll(Collection toAdd) Adds the given elements to the set.voidFires a change notification for all elements in the given arrayvoidclear()Empties the setObject[]Return the contents of the model.voidRemoves all of the given elements from the set.voidrequestUpdate(IConcurrentModelListener listener) Requests that the receiver to call the given listener's setContents(...)voidSets the contents to the given array of elementsMethods inherited from class org.eclipse.jface.viewers.deferred.AbstractConcurrentModeladdListener, fireAdd, fireRemove, fireUpdate, getListeners, removeListener
- 
Constructor Details- 
SetModelpublic SetModel()
 
- 
- 
Method Details- 
getElementsReturn the contents of the model.- Returns:
- the array of elements
 
- 
setSets the contents to the given array of elements- Parameters:
- newContents- new contents of this set
 
- 
clearpublic void clear()Empties the set
- 
addAllAdds the given elements to the set- Parameters:
- toAdd- elements to add
 
- 
addAllAdds the given elements to the set. Duplicate elements are ignored.- Parameters:
- toAdd- elements to add
 
- 
changeAllFires a change notification for all elements in the given array- Parameters:
- changed- array of elements that have changed
 
- 
removeAllRemoves all of the given elements from the set.- Parameters:
- toRemove- elements to remove
 
- 
requestUpdateDescription copied from interface:IConcurrentModelRequests 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.
 
 
-