APIdia Launch Partner
Top Description Inners Methods
javafx.collections

public Interface SetChangeListener<E>

Known Direct Implementers
javafx.collections.WeakSetChangeListener, com.sun.javafx.binding.BidirectionalContentBinding.SetContentBinding, com.sun.javafx.binding.ContentBinding.SetContentBinding
Annotations
@FunctionalInterface
Type Parameters
<E>
the element type

Interface that receives notifications of changes to an ObservableSet.
Since
JavaFX 2.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
SetChangeListener.Change<
element type
E
>

An elementary change done to an ObservableSet.

Method Summary

Modifier and TypeMethod and Description
public void
onChanged(SetChangeListener.Change<? extends E>
the change that was made
change
)

Called after a change has been made to an ObservableSet.

Method Detail

onChangedback to summary
public void onChanged(SetChangeListener.Change<? extends E> change)

Called after a change has been made to an ObservableSet. This method is called on every elementary change (add/remove) once. This means, complex changes like removeAll(Collection) or clear() may result in more than one call of onChanged method.

Parameters
change:SetChangeListener.Change<? extends E>

the change that was made

javafx.collections back to summary

public abstract Class SetChangeListener.Change<E>

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.javafx.binding.SetExpressionHelper.SimpleChange, com.sun.javafx.collections.ObservableSetWrapper.SimpleAddChange, com.sun.javafx.collections.ObservableSetWrapper.SimpleRemoveChange, com.sun.javafx.collections.SetAdapterChange
Type Parameters
<E>
element type

An elementary change done to an ObservableSet. Change contains information about an add or remove operation. Note that adding element that is already in the set does not modify the set and hence no change will be generated.
Since
JavaFX 2.1

Field Summary

Modifier and TypeField and Description
private ObservableSet<E>

Constructor Summary

AccessConstructor and Description
public
Change(ObservableSet<E>
the source of the change
set
)

Constructs a change associated with a set.

Method Summary

Modifier and TypeMethod and Description
public abstract E

Returns:

the element that was just added
getElementAdded
()

Get the new element.

public abstract E

Returns:

the element that was just removed
getElementRemoved
()

Get the old element.

public ObservableSet<E>

Returns:

the source set
getSet
()

An observable set that is associated with the change.

public abstract boolean

Returns:

true if a new element was added to the set
wasAdded
()

If this change is a result of add operation.

public abstract boolean

Returns:

true if an old element was removed from the set
wasRemoved
()

If this change is a result of removal operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

setback to summary
private ObservableSet<E> set

Constructor Detail

Changeback to summary
public Change(ObservableSet<E> set)

Constructs a change associated with a set.

Parameters
set:ObservableSet<E>

the source of the change

Method Detail

getElementAddedback to summary
public abstract E getElementAdded()

Get the new element. Return null if this is a removal.

Returns:E

the element that was just added

getElementRemovedback to summary
public abstract E getElementRemoved()

Get the old element. Return null if this is an addition.

Returns:E

the element that was just removed

getSetback to summary
public ObservableSet<E> getSet()

An observable set that is associated with the change.

Returns:ObservableSet<E>

the source set

wasAddedback to summary
public abstract boolean wasAdded()

If this change is a result of add operation.

Returns:boolean

true if a new element was added to the set

wasRemovedback to summary
public abstract boolean wasRemoved()

If this change is a result of removal operation.

Returns:boolean

true if an old element was removed from the set