public class SetModel extends AbstractConcurrentModel
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.Constructor and Description |
---|
SetModel() |
Modifier and Type | Method and Description |
---|---|
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
|
addListener, fireAdd, fireRemove, fireUpdate, getListeners, removeListener
public Object[] getElements()
public void set(Object[] newContents)
newContents
- new contents of this setpublic void clear()
public void addAll(Object[] toAdd)
toAdd
- elements to addpublic void addAll(Collection toAdd)
toAdd
- elements to addpublic void changeAll(Object[] changed)
changed
- array of elements that have changedpublic void removeAll(Object[] toRemove)
toRemove
- elements to removepublic void requestUpdate(IConcurrentModelListener listener)
IConcurrentModel
Has no effect if an update is already queued for an identical listener.
listener
- listener whose setContents method should be called. The
listener must have been previously registered with addListener.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.