Package com.storedobject.core
Class ObjectForest<T extends StoredObject>
java.lang.Object
com.storedobject.core.ObjectForest<T>
- All Implemented Interfaces:
Filtered<T>
,FilterMethods<T>
,ObjectLoader<T>
,AutoCloseable
public class ObjectForest<T extends StoredObject>
extends Object
implements Filtered<T>, ObjectLoader<T>, AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
ConstructorsConstructorDescriptionObjectForest
(boolean large, int linkType, Class<T> objectClass, boolean any) ObjectForest
(int linkType, Class<T> objectClass, boolean any, Function<Class<T>, ObjectList<T>> listSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called whenever a filter predicate is changed.void
close()
void
void
filter
(Predicate<? super T> filter, Comparator<? super T> comparator) Comparator
<? super T> BiFunction
<StoredObjectUtility.Link<?>, StoredObject, ObjectIterator<? extends StoredObject>> Get the load filter.The class of the instances.getRoots()
<M extends StoredObject>
booleanvoid
final boolean
Retrieve sub-classes?void
load
(int linkType, StoredObject master, String condition, String orderedBy, boolean any) Load the links of the given "master" instance.void
load
(ObjectIterator<T> objects) Load the given instances.void
Load the instances created from the list ofId
s.void
Load the instances.void
Load the given instances.void
order
(Comparator<? super T> comparator) void
refresh()
void
void
void
setLinkVisibility
(Predicate<StoredObjectUtility.Link<?>> linkVisibility) void
setListLinks
(BiFunction<StoredObjectUtility.Link<?>, StoredObject, ObjectIterator<? extends StoredObject>> listLinks) void
setLoadFilter
(Predicate<T> loadFilter) Set the load filter.int
size()
Get the instances count.int
size
(int startingIndex, int endingIndex) int
int
int
sizeAll()
int
stream
(int startingIndex, int endingIndex) streamAll
(int startingIndex, int endingIndex) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.core.FilterMethods
getEffectiveCondition, getFilterCondition, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setLoadFilter, setViewFilter, setViewFilter
Methods inherited from interface com.storedobject.core.ObjectLoader
applyFilter, canContain, clear, getAllowAny, getLinkType, getMaster, getOrderBy, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, reload, setLinkType, setLinkType, setMaster, setMaster, setOrderBy, setOrderBy
-
Constructor Details
-
ObjectForest
-
ObjectForest
-
-
Method Details
-
hideLinkLabels
public void hideLinkLabels() -
setLinkVisibility
-
getLinkVisibility
-
setListLinks
public void setListLinks(BiFunction<StoredObjectUtility.Link<?>, StoredObject, ObjectIterator<? extends StoredObject>> listLinks) -
getListLinks
public BiFunction<StoredObjectUtility.Link<?>,StoredObject, getListLinks()ObjectIterator<? extends StoredObject>> -
setLoadFilter
Description copied from interface:FilterMethods
Set the load filter. This will be applied whenever loading takes place.- Specified by:
setLoadFilter
in interfaceFilterMethods<T extends StoredObject>
- Parameters:
loadFilter
- Load filter to be applied while loading.
-
applyFilterPredicate
public void applyFilterPredicate()Description copied from interface:FilterMethods
This method is called whenever a filter predicate is changed. Methods with default implementation already invoke this method. If any of those methods are overridden, make sure that it invokes this method so that logic to handle filter changes can be coded here.Note: This method is used to show the filtered result of the existing entries
- Specified by:
applyFilterPredicate
in interfaceFilterMethods<T extends StoredObject>
-
getLoadFilter
Description copied from interface:FilterMethods
Get the load filter.- Specified by:
getLoadFilter
in interfaceFilterMethods<T extends StoredObject>
- Returns:
- Current load filter.
-
getRoots
-
order
- Specified by:
order
in interfaceFiltered<T extends StoredObject>
-
filter
-
filter
- Specified by:
filter
in interfaceFiltered<T extends StoredObject>
-
getFilter
-
getComparator
- Specified by:
getComparator
in interfaceFiltered<T extends StoredObject>
-
size
public int size()Description copied from interface:ObjectLoader
Get the instances count.- Specified by:
size
in interfaceFiltered<T extends StoredObject>
- Specified by:
size
in interfaceObjectLoader<T extends StoredObject>
- Returns:
- Count.
-
size
-
size
public int size(int startingIndex, int endingIndex) - Specified by:
size
in interfaceFiltered<T extends StoredObject>
-
size
-
sizeAll
public int sizeAll()- Specified by:
sizeAll
in interfaceFiltered<T extends StoredObject>
-
sizeAll
-
stream
-
stream
-
streamAll
-
streamAll
-
load
Description copied from interface:ObjectLoader
Load the instances. Current "load filter" if set will be applied. If "master" is already set, "links" of the "master" will be loaded.- Specified by:
load
in interfaceObjectLoader<T extends StoredObject>
- Parameters:
condition
- Filtering condition to be applied.orderedBy
- "ORDER BY" clause to use while loading.any
- Whether instanced of the subclasses to be retrieved or not.
-
load
public void load(int linkType, StoredObject master, String condition, String orderedBy, boolean any) Description copied from interface:ObjectLoader
Load the links of the given "master" instance. Current "load filter" if set will be applied.- Specified by:
load
in interfaceObjectLoader<T extends StoredObject>
- Parameters:
linkType
- Link type.master
- Master instance.condition
- Filtering condition to be applied.orderedBy
- "ORDER BY" clause to use while loading.any
- Whether instanced of the subclasses to be retrieved or not.
-
load
Description copied from interface:ObjectLoader
Load the instances created from the list ofId
s. Current "load filter" if set will be applied. However,ObjectLoader.getOrderBy()
result will be ignored. Also, the value returned byObjectLoader.getAllowAny()
will determine whether instanced of the subclasses to be restricted or not.- Specified by:
load
in interfaceObjectLoader<T extends StoredObject>
- Parameters:
idList
- List ofId
s from which objects to be loaded.
-
load
Description copied from interface:ObjectLoader
Load the given instances. Current "load filter" if set will be applied. However,ObjectLoader.getOrderBy()
result will be ignored. Also, the value returned byObjectLoader.getAllowAny()
will determine whether instanced of the subclasses to be restricted or not.- Specified by:
load
in interfaceObjectLoader<T extends StoredObject>
- Parameters:
objects
- Objects to be loaded.
-
load
Description copied from interface:ObjectLoader
Load the given instances. Current "load filter" if set will be applied. However,ObjectLoader.getOrderBy()
result will be ignored. Also, the value returned byObjectLoader.getAllowAny()
will determine whether instanced of the subclasses to be restricted or not.- Specified by:
load
in interfaceObjectLoader<T extends StoredObject>
- Parameters:
objects
- Objects to be loaded.
-
getObjectClass
Description copied from interface:ObjectLoader
The class of the instances.- Specified by:
getObjectClass
in interfaceObjectLoader<T extends StoredObject>
- Returns:
- The class of the instances to load.
-
isAllowAny
public final boolean isAllowAny()Description copied from interface:ObjectLoader
Retrieve sub-classes?- Specified by:
isAllowAny
in interfaceObjectLoader<T extends StoredObject>
- Returns:
- Whether instanced of the subclasses to be retrieved or not.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
refresh
public void refresh() -
refresh
-
refresh
-
hideLink
-