S
- type of the source objectE
- type of the elements in the setpublic abstract class SetProperty<S,E> extends Object implements ISetProperty<S,E>
Constructor and Description |
---|
SetProperty() |
Modifier and Type | Method and Description |
---|---|
protected Set<E> |
doGetSet(S source)
Returns a Set with the current contents of the source's set property
|
protected void |
doSetSet(S source,
Set<E> set)
Updates the property on the source with the specified change.
|
protected void |
doUpdateSet(S source,
SetDiff<E> diff)
Updates the property on the source with the specified change.
|
Set<E> |
getSet(S source)
By default, this method returns
Collections.EMPTY_SET in
case the source object is null . |
IObservableSet<E> |
observe(S source)
Returns an observable set observing this set property on the given
property source
|
<U extends S> |
observeDetail(IObservableValue<U> master)
Returns an observable set on the master observable's realm which tracks
this property of the current value of
master . |
IObservableFactory<S,IObservableSet<E>> |
setFactory()
Returns a factory for creating observable sets tracking this property of
a particular property source.
|
IObservableFactory<S,IObservableSet<E>> |
setFactory(Realm realm)
Returns a factory for creating observable sets in the given realm,
tracking this property of a particular property source.
|
void |
setSet(S source,
Set<E> set)
Updates the property on the source with the specified change.
|
void |
updateSet(S source,
SetDiff<E> diff)
Updates the property on the source with the specified change.
|
<T> IMapProperty<S,E,T> |
values(IValueProperty<? super E,T> detailValues)
Returns the nested combination of this property and the specified detail
value property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElementType, observe
public Set<E> getSet(S source)
Collections.EMPTY_SET
in
case the source object is null
. Otherwise, this method
delegates to doGetSet(Object)
.
Clients may override this method if they e.g. want to return a specific
default set in case the source object is null
.
getSet
in interface ISetProperty<S,E>
source
- the property source (may be null)doGetSet(Object)
protected Set<E> doGetSet(S source)
source
- the property sourcepublic final void setSet(S source, Set<E> set)
ISetProperty
Note: This method is made available to facilitate basic property
access. However if the property source lacks property change
notification, then observables on the source object may not be notified
of the change. In most cases it is preferable to modify the source
through an IObservableSet
than through the property directly.
setSet
in interface ISetProperty<S,E>
source
- the property source (may be null)set
- the new setprotected void doSetSet(S source, Set<E> set)
source
- the property sourceset
- the new setpublic final void updateSet(S source, SetDiff<E> diff)
ISetProperty
Note: This method is made available to facilitate basic property
access. However if the property source lacks property change
notification, then observables on the source object may not be notified
of the change. In most cases it is preferable to modify the source
through an IObservableSet
than through the property directly.
updateSet
in interface ISetProperty<S,E>
source
- the property source (may be null)diff
- a diff describing the changeprotected void doUpdateSet(S source, SetDiff<E> diff)
source
- the property sourcediff
- a diff describing the changepublic IObservableSet<E> observe(S source)
ISetProperty
observe
in interface ISetProperty<S,E>
source
- the property sourcepublic IObservableFactory<S,IObservableSet<E>> setFactory()
ISetProperty
setFactory
in interface ISetProperty<S,E>
public IObservableFactory<S,IObservableSet<E>> setFactory(Realm realm)
ISetProperty
setFactory
in interface ISetProperty<S,E>
realm
- the realmpublic <U extends S> IObservableSet<E> observeDetail(IObservableValue<U> master)
ISetProperty
master
.observeDetail
in interface ISetProperty<S,E>
master
- the master observablemaster
.public final <T> IMapProperty<S,E,T> values(IValueProperty<? super E,T> detailValues)
ISetProperty
IObservableMap.put(Object, Object)
and
Map.putAll(java.util.Map)
methods. In the latter case,
this property does not put entries for keys not already in the master key
set. Modifications made through the returned property are delegated to
the detail property, using the corresponding set element from the master
property as the source.values
in interface ISetProperty<S,E>
detailValues
- the detail property
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.