Spec-Zone .ru
спецификации, руководства, описания, API
|
public class FXCollections
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <E> ObservableList<E> |
checkedObservableList(ObservableList<E> list,
java.lang.Class<E> type)
Creates and returns a typesafe wrapper on top of provided observable list.
|
static <E> ObservableList<E> |
concat(ObservableList<E>... lists)
Concatenates more observable lists into one.
|
static <T> void |
copy(ObservableList<? super T> dest,
java.util.List<? extends T> src)
Copies elements from src to dest.
|
static <E> ObservableList<E> |
emptyObservableList()
Creates and empty unmodifiable observable list.
|
static <T> void |
fill(ObservableList<? super T> list,
T obj)
Fills the provided list with obj.
|
static <E> ObservableList<E> |
observableArrayList()
Creates a new empty observable list that is backed by an arraylist.
|
static <E> ObservableList<E> |
observableArrayList(Callback<E,Observable[]> extractor)
Creates a new empty observable list backed by an arraylist.
|
static <E> ObservableList<E> |
observableArrayList(java.util.Collection<? extends E> col)
Creates a new observable array list and adds a content of collection
col
to it. |
static <E> ObservableList<E> |
observableArrayList(E... items)
Creates a new observable array list with
items added to it. |
static <K,V> ObservableMap<K,V> |
observableHashMap()
Creates a new empty observable map that is backed by a HashMap.
|
static <E> ObservableList<E> |
observableList(java.util.List<E> list)
Constructs an ObservableList that is backed by the specified list.
|
static <E> ObservableList<E> |
observableList(java.util.List<E> list,
Callback<E,Observable[]> extractor)
Constructs an ObservableList that is backed by the specified list.
|
static <K,V> ObservableMap<K,V> |
observableMap(java.util.Map<K,V> map)
Constructs an ObservableMap that is backed by the specified map.
|
static <E> ObservableSet<E> |
observableSet(E... elements)
Constructs an ObservableSet that contains all the specified elements.
|
static <E> ObservableSet<E> |
observableSet(java.util.Set<E> set)
Constructs an ObservableSet that is backed by the specified set.
|
static <T> boolean |
replaceAll(ObservableList<T> list,
T oldVal,
T newVal)
Replace all oldVal elements in the list with newVal element.
|
static void |
reverse(ObservableList list)
Reverse the order in the list
Fires only one change notification on the list.
|
static void |
rotate(ObservableList list,
int distance)
Rotates the list by distance.
|
static void |
shuffle(ObservableList<?> list)
Shuffles all elements in the observable list.
|
static void |
shuffle(ObservableList list,
java.util.Random rnd)
Shuffles all elements in the observable list.
|
static <E> ObservableList<E> |
singletonObservableList(E e)
Creates an unmodifiable observable list with single element.
|
static <T extends java.lang.Comparable<? super T>> |
sort(ObservableList<T> list)
Sorts the provided observable list.
|
static <T> void |
sort(ObservableList<T> list,
java.util.Comparator<? super T> c)
Sorts the provided observable list using the c comparator.
|
static <E> ObservableList<E> |
synchronizedObservableList(ObservableList<E> list)
Creates and returns a synchronized wrapper on top of provided observable list.
|
static <E> ObservableList<E> |
unmodifiableObservableList(ObservableList<E> list)
Creates and returns unmodifiable wrapper list on top of provided observable list.
|
static <K,V> ObservableMap<K,V> |
unmodifiableObservableMap(ObservableMap<K,V> map)
Constructs a read-only interface to the specified ObservableMap.
|
public static <E> ObservableList<E> observableList(java.util.List<E> list)
list
- a concrete List that backs this ObservableListpublic static <E> ObservableList<E> observableList(java.util.List<E> list, Callback<E,Observable[]> extractor)
extractor
.
Observable objects returned by extractor (applied to each list element) are listened for changes
and transformed into "update" change of ListChangeListener.list
- a concrete List that backs this ObservableListextractor
- element to Observable[] convertorpublic static <K,V> ObservableMap<K,V> observableMap(java.util.Map<K,V> map)
map
- a Map that backs this ObservableMappublic static <E> ObservableSet<E> observableSet(java.util.Set<E> set)
set
- a Set that backs this ObservableSetpublic static <E> ObservableSet<E> observableSet(E... elements)
elements
- elements that will be added into returned ObservableSetpublic static <K,V> ObservableMap<K,V> unmodifiableObservableMap(ObservableMap<K,V> map)
map
- an ObservableMap that is to be monitored by this interfacepublic static <E> ObservableList<E> observableArrayList()
observableList(java.util.List)
public static <E> ObservableList<E> observableArrayList(Callback<E,Observable[]> extractor)
extractor
- element to Observable[] convertor. Observable objects are listened for changes on the element.observableList(java.util.List, javafx.util.Callback)
public static <E> ObservableList<E> observableArrayList(E... items)
items
added to it.items
- the items that will be in the new observable ArrayListobservableArrayList()
public static <E> ObservableList<E> observableArrayList(java.util.Collection<? extends E> col)
col
to it.col
- a collection which content should be added to the observableArrayListpublic static <K,V> ObservableMap<K,V> observableHashMap()
K
- the type of keysV
- the type of valuespublic static <E> ObservableList<E> concat(ObservableList<E>... lists)
lists
- lists to concatenatepublic static <E> ObservableList<E> unmodifiableObservableList(ObservableList<E> list)
list
- an ObservableList that is to be wrappedCollections.unmodifiableList(java.util.List)
public static <E> ObservableList<E> checkedObservableList(ObservableList<E> list, java.lang.Class<E> type)
list
- an Observable list to be wrappedtype
- the type of element that list is permitted to holdCollections.checkedList(java.util.List, java.lang.Class)
public static <E> ObservableList<E> synchronizedObservableList(ObservableList<E> list)
list
- the list to be "wrapped" in a synchronized list.Collections.synchronizedList(java.util.List)
public static <E> ObservableList<E> emptyObservableList()
Collections.emptyList()
public static <E> ObservableList<E> singletonObservableList(E e)
e
- the only elements that will be contained in this singleton observable listCollections.singletonList(java.lang.Object)
public static <T> void copy(ObservableList<? super T> dest, java.util.List<? extends T> src)
dest
- the destination observable listsrc
- the source listCollections.copy(java.util.List, java.util.List)
public static <T> void fill(ObservableList<? super T> list, T obj)
list
- the list to fillobj
- the object to fill the list withCollections.fill(java.util.List, java.lang.Object)
public static <T> boolean replaceAll(ObservableList<T> list, T oldVal, T newVal)
list
- the list which will have it's elements replacedoldVal
- the element that is going to be replacenewVal
- the replacementCollections.replaceAll(java.util.List, java.lang.Object, java.lang.Object)
public static void reverse(ObservableList list)
list
- the list to be reversedCollections.reverse(java.util.List)
public static void rotate(ObservableList list, int distance)
list
- the list to be rotateddistance
- the distance of rotationCollections.rotate(java.util.List, int)
public static void shuffle(ObservableList<?> list)
list
- the list to shuffleCollections.shuffle(java.util.List)
public static void shuffle(ObservableList list, java.util.Random rnd)
list
- the list to be shuffledrnd
- the random generator used for shufflingCollections.shuffle(java.util.List, java.util.Random)
public static <T extends java.lang.Comparable<? super T>> void sort(ObservableList<T> list)
Collections.sort(java.util.List)
public static <T> void sort(ObservableList<T> list, java.util.Comparator<? super T> c)
list
- the list to sortc
- comparator used for sorting. Null if natural ordering is required.Collections.sort(java.util.List, java.util.Comparator)
Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to