T
- data typepublic class TreeDataProvider<T> extends AbstractHierarchicalDataProvider<T,SerializablePredicate<T>> implements InMemoryDataProvider<T>
TreeData
as its source of data.Constructor and Description |
---|
TreeDataProvider(TreeData<T> treeData)
Constructs a new TreeDataProvider.
|
Modifier and Type | Method and Description |
---|---|
Stream<T> |
fetchChildren(HierarchicalQuery<T,SerializablePredicate<T>> query)
Fetches data from this HierarchicalDataProvider using given
query . |
int |
getChildCount(HierarchicalQuery<T,SerializablePredicate<T>> query)
Get the number of immediate child data items for the parent item returned
by a given query.
|
SerializablePredicate<T> |
getFilter()
Gets the current filter of this data provider.
|
SerializableComparator<T> |
getSortComparator()
Gets the current sort comparator of this data provider.
|
TreeData<T> |
getTreeData()
Return the underlying hierarchical data of this provider.
|
boolean |
hasChildren(T item)
Check whether a given item has any children associated with it.
|
void |
setFilter(SerializablePredicate<T> filter)
Sets a filter to be applied to all queries.
|
void |
setSortComparator(SerializableComparator<T> comparator)
Sets the comparator to use as the default sorting for this data provider.
|
withConfigurableFilter, withConfigurableFilter, withConvertedFilter
addDataProviderListener, addListener, fireEvent, refreshAll, refreshItem, refreshItem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addFilter, addFilter, addFilterByValue, addSortComparator, addSortOrder, clearFilters, filteringBy, filteringBy, filteringByEquals, filteringByPrefix, filteringByPrefix, filteringBySubstring, filteringBySubstring, isInMemory, setFilter, setFilterByValue, setSortOrder
addDataProviderListener, fetch, fromCallbacks, fromFilteringCallbacks, fromStream, getId, ofCollection, ofItems, refreshAll, refreshItem, refreshItem, size, withConfigurableFilter, withConfigurableFilter, withConvertedFilter
fetch, size
public TreeData<T> getTreeData()
public boolean hasChildren(T item)
HierarchicalDataProvider
hasChildren
in interface HierarchicalDataProvider<T,SerializablePredicate<T>>
item
- the item to check for childrenpublic int getChildCount(HierarchicalQuery<T,SerializablePredicate<T>> query)
HierarchicalDataProvider
getChildCount
in interface HierarchicalDataProvider<T,SerializablePredicate<T>>
query
- given query to request the count forHierarchicalQuery.getParent()
public Stream<T> fetchChildren(HierarchicalQuery<T,SerializablePredicate<T>> query)
HierarchicalDataProvider
query
. Only the immediate children of
HierarchicalQuery.getParent()
will be returned.fetchChildren
in interface HierarchicalDataProvider<T,SerializablePredicate<T>>
query
- given query to request data withpublic SerializablePredicate<T> getFilter()
InMemoryDataProvider
getFilter
in interface InMemoryDataProvider<T>
public void setFilter(SerializablePredicate<T> filter)
InMemoryDataProvider
setFilter
in interface ConfigurableFilterDataProvider<T,SerializablePredicate<T>,SerializablePredicate<T>>
setFilter
in interface InMemoryDataProvider<T>
filter
- the filter to set, or null
to remove any set
filtersInMemoryDataProvider.setFilter(ValueProvider, SerializablePredicate)
,
InMemoryDataProvider.setFilterByValue(ValueProvider, Object)
,
InMemoryDataProvider.addFilter(SerializablePredicate)
public SerializableComparator<T> getSortComparator()
InMemoryDataProvider
getSortComparator
in interface InMemoryDataProvider<T>
public void setSortComparator(SerializableComparator<T> comparator)
InMemoryDataProvider
The default sorting is used if the query defines no sorting. The default sorting is also used to determine the ordering of items that are considered equal by the sorting defined in the query.
setSortComparator
in interface InMemoryDataProvider<T>
comparator
- a comparator to use, or null
to clear any
previously set sort orderInMemoryDataProvider.setSortOrder(ValueProvider, SortDirection)
,
InMemoryDataProvider.addSortComparator(SerializableComparator)
Copyright © 2023. All rights reserved.