public class CollectionUtils
extends java.lang.Object
CollectionUtils contains a method to compute the old value of an
ObservableList for a given
ListChangeListener.Change event. For details, see
getPreviousContents(javafx.collections.ListChangeListener.Change).| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <E> ObservableMultiset<E> |
emptyMultiset()
Returns an empty, unmodifiable
ObservableMultiset. |
static <E> javafx.collections.ObservableSet<E> |
emptySet()
Returns an empty, unmodifiable
ObservableSet. |
static <K,V> ObservableSetMultimap<K,V> |
emptySetMultimap()
Returns an empty, unmodifiable
ObservableSetMultimap. |
static <E> int[] |
getPermutation(javafx.collections.ListChangeListener.Change<? extends E> change)
Computes the permutation for the given
ListChangeListener.Change. |
static <E> java.util.List<E> |
getPreviousContents(javafx.collections.ListChangeListener.Change<E> change)
Computes the previous contents of the source
ObservableList
before the given ListChangeListener.Change was
applied. |
static <E> javafx.collections.ObservableList<E> |
observableArrayList()
Returns a (modifiable) new
ObservableList wrapping an
ArrayList. |
static <K,V> ObservableSetMultimap<K,V> |
observableHashMultimap()
Returns a (modifiable) new
ObservableSetMultimap wrapping a
HashMultimap. |
static <E> ObservableMultiset<E> |
observableHashMultiset()
Returns a (modifiable) new
ObservableMultiset wrapping a
HashMultiset. |
static <E> javafx.collections.ObservableList<E> |
observableList(java.util.List<E> list)
Returns a (modifiable) new
ObservableList wrapping the given
List. |
static <E> ObservableMultiset<E> |
observableMultiset(com.google.common.collect.Multiset<E> multiset)
Returns a (modifiable) new
ObservableMultiset wrapping the given
List. |
static <K,V> ObservableSetMultimap<K,V> |
observableSetMultimap(com.google.common.collect.SetMultimap<K,V> setMultimap)
Returns a (modifiable) new
ObservableSetMultimap wrapping the
given SetMultimap. |
static <E> ObservableMultiset<E> |
unmodifiableObservableMultiset(ObservableMultiset<E> multiset)
Returns an unmodifiable
ObservableMultiset wrapping the given
ObservableMultiset. |
static <E> javafx.collections.ObservableSet<E> |
unmodifiableObservableSet(javafx.collections.ObservableSet<E> set)
Returns an unmodifiable
ObservableSet wrapping the given
ObservableSet. |
static <K,V> ObservableSetMultimap<K,V> |
unmodifiableObservableSetMultimap(ObservableSetMultimap<K,V> setMultimap)
Returns an unmodifiable
ObservableSetMultimap wrapping the given
ObservableSetMultimap. |
public static <E> ObservableMultiset<E> emptyMultiset()
ObservableMultiset.E - The element type of the ObservableMultiset.ObservableMultiset.public static <E> javafx.collections.ObservableSet<E> emptySet()
ObservableSet.E - The element type of the ObservableSet.ObservableSet.public static <K,V> ObservableSetMultimap<K,V> emptySetMultimap()
ObservableSetMultimap.K - The key type of the ObservableSetMultimap.V - The value type of the ObservableSetMultimap.ObservableSetMultimap.public static <E> int[] getPermutation(javafx.collections.ListChangeListener.Change<? extends E> change)
ListChangeListener.Change.E - The element type of the ObservableList that was
changed.change - The change, for which ListChangeListener.Change.wasPermutated() has to
return true.public static <E> java.util.List<E> getPreviousContents(javafx.collections.ListChangeListener.Change<E> change)
ObservableList
before the given ListChangeListener.Change was
applied.E - The element type of the ObservableList.change - The ListChangeListener.Change for
which to compute the previous contents.List that resembles the state of the
source ObservableList before the change.public static <E> javafx.collections.ObservableList<E> observableArrayList()
ObservableList wrapping an
ArrayList.E - The element type of the ObservableList. The
List to wrap.ObservableList wrapping the given List.public static <K,V> ObservableSetMultimap<K,V> observableHashMultimap()
ObservableSetMultimap wrapping a
HashMultimap.K - The key type of the ObservableSetMultimap.V - The value type of the ObservableSetMultimapObservableSetMultimap wrapping a HashMultimap.public static <E> ObservableMultiset<E> observableHashMultiset()
ObservableMultiset wrapping a
HashMultiset.E - The element type of the ObservableList.ObservableMultiset wrapping a HashMultiset.public static <E> javafx.collections.ObservableList<E> observableList(java.util.List<E> list)
ObservableList wrapping the given
List.E - The element type of the ObservableList.list - The List to wrap.ObservableList wrapping the given List.public static <E> ObservableMultiset<E> observableMultiset(com.google.common.collect.Multiset<E> multiset)
ObservableMultiset wrapping the given
List.E - The element type of the ObservableList.multiset - The Multiset to wrap.ObservableMultiset wrapping the given List.public static <K,V> ObservableSetMultimap<K,V> observableSetMultimap(com.google.common.collect.SetMultimap<K,V> setMultimap)
ObservableSetMultimap wrapping the
given SetMultimap.K - The key type of the ObservableSetMultimap.V - The value type of the ObservableSetMultimapsetMultimap - The SetMultimap to wrap.ObservableSetMultimap wrapping the given List.public static <E> ObservableMultiset<E> unmodifiableObservableMultiset(ObservableMultiset<E> multiset)
ObservableMultiset wrapping the given
ObservableMultiset.E - The element type of the ObservableMultiset.multiset - The ObservableMultiset to wrap.ObservableMultiset.public static <E> javafx.collections.ObservableSet<E> unmodifiableObservableSet(javafx.collections.ObservableSet<E> set)
ObservableSet wrapping the given
ObservableSet.E - The element type of the ObservableSet.set - The ObservableSet to wrap.ObservableSet.public static <K,V> ObservableSetMultimap<K,V> unmodifiableObservableSetMultimap(ObservableSetMultimap<K,V> setMultimap)
ObservableSetMultimap wrapping the given
ObservableSetMultimap.K - The key type of the ObservableSetMultimap.V - The value type of the ObservableSetMultimap.setMultimap - The ObservableSetMultimap to wrap.ObservableSetMultimap.Copyright (c) 2014 itemis AG and others. All rights reserved.