public class CollectionBindings extends Object
This class contains custom binding implementations for collections.
| Constructor and Description |
|---|
CollectionBindings() |
| Modifier and Type | Method and Description |
|---|---|
static <T> ObservableList<T> |
concat(ObservableList<T>... lists)
Creates an observable list that represents the concatenated source lists.
|
static NumberBinding |
sum(ObservableList<? extends Number> numbers)
Creates a number binding that contains the sum of the numbers of the given observable list of numbers.
|
public static NumberBinding sum(ObservableList<? extends Number> numbers)
Creates a number binding that contains the sum of the numbers of the given observable list of numbers.
numbers - the observable list of numbers.@SafeVarargs public static <T> ObservableList<T> concat(ObservableList<T>... lists)
Creates an observable list that represents the concatenated source lists. All elements from the all source lists will be contained in the new list. If there is a change in any of the source lists this change will also be done in the concatenated list.
The order of elements will be maintained. All elements of the first source list will be located before all elements of the second list and so on. So if an element is added to the first list, this element will be located between the old elements of the first list and the second list’s elements.
Hint: *At the moment this observable list is implemented with InvalidationListeners on the source lists and by clearing and recreating the concatenated list on every change. This should be keeped in mind when using a ListChangeListener on the concatenated list as it will react multiple times when a change is done to one of the source lists.
This behaviour will likely be changed in the future as it means a performance limitation too.
lists - a var-args array of observable lists.T - the generic type of the lists.