public class RadDataSource<E> extends Object implements CollectionChangeListener<E>, Iterable<DataItem<E>>
Iterable
implementation.Constructor and Description |
---|
RadDataSource()
Creates an instance of the
RadDataSource
class. |
RadDataSource(Iterable<E> source)
Creates an instance of the
RadDataSource class
and initializes it with the provided source. |
Modifier and Type | Method and Description |
---|---|
void |
addDataChangeListener(DataChangedListener<E> listener) |
void |
collectionChanged(CollectionChangedEvent<E> info)
This method handles the occurred change and notifies the change listeners.
|
static RadDataSource<JSONObject> |
createFromJson(String json) |
static void |
createFromJsonUrl(URL url,
OnJSONDataSourceCreated result) |
ObservableCollection<Function<E,Boolean>> |
filterDescriptors()
Provides a collection of filter descriptors that
are used to apply filtering operations on the
Iterable source currently
initialized with this RadDataSource instance. |
List<DataItem<E>> |
flatView()
Returns a List that is filtered, sorted and grouped according to the current descriptors.
|
Iterable<E> |
getSource()
Gets the data source on which this
RadDataSource
instance operates. |
ObservableCollection<Function<E,Object>> |
groupDescriptors()
Provides a collection of group descriptors that
are used to apply grouping operations on the
Iterable source currently
initialized with this RadDataSource instance. |
void |
invalidateDescriptors() |
Iterator<DataItem<E>> |
iterator() |
void |
removeDataChangeListener(DataChangedListener<E> listener) |
void |
resumeUpdate() |
void |
resumeUpdate(boolean refresh)
Resumes the tracking of data descriptor collection changes for this
RadDataSource
instance. |
void |
setSource(Iterable<E> source)
Sets an
Iterable implementation representing the data source on which
the current RadDataSource will operate on. |
ObservableCollection<Function2<E,E,Integer>> |
sortDescriptors()
Provides a collection of sort descriptors that
are used to apply grouping operations on the
Iterable source currently
initialized with this RadDataSource instance. |
void |
suspendUpdate()
Suspends the tracking of data descriptor collection changes for this
RadDataSource
instance. |
List<DataItem<E>> |
view()
Returns a List that is filtered, sorted and grouped according to the current descriptors.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public RadDataSource()
RadDataSource
class.public RadDataSource(Iterable<E> source)
RadDataSource
class
and initializes it with the provided source.source
- an Iterable
implementation providing the data source
to perform the data operations on.public void addDataChangeListener(DataChangedListener<E> listener)
public void removeDataChangeListener(DataChangedListener<E> listener)
public static RadDataSource<JSONObject> createFromJson(String json) throws JSONException
JSONException
public static void createFromJsonUrl(URL url, OnJSONDataSourceCreated result)
public Iterable<E> getSource()
RadDataSource
instance operates.Iterable
that representspublic ObservableCollection<Function<E,Boolean>> filterDescriptors()
Iterable
source currently
initialized with this RadDataSource
instance.ObservableCollection
containing
the filter descriptors.public ObservableCollection<Function<E,Object>> groupDescriptors()
Iterable
source currently
initialized with this RadDataSource
instance.ObservableCollection
containing
the group descriptors.public ObservableCollection<Function2<E,E,Integer>> sortDescriptors()
Iterable
source currently
initialized with this RadDataSource
instance.ObservableCollection
containing
the sort descriptors.public List<DataItem<E>> view()
Iterable
implementation representing the data view.public List<DataItem<E>> flatView()
public void suspendUpdate()
RadDataSource
instance.public void resumeUpdate()
public void resumeUpdate(boolean refresh)
RadDataSource
instance.refresh
- if set totrue
refreshes the view immediately.public void collectionChanged(CollectionChangedEvent<E> info)
CollectionChangeListener
collectionChanged
in interface CollectionChangeListener<E>
info
- info about the occurred change holding the old and the new data.CollectionChangedEvent
public void setSource(Iterable<E> source)
Iterable
implementation representing the data source on which
the current RadDataSource
will operate on.source
- the Iterable
implementation.public void invalidateDescriptors()