Package com.storedobject.core
Class ObjectMemoryList<T extends StoredObject>
java.lang.Object
com.storedobject.core.MemoryCache<T>
com.storedobject.core.ObjectMemoryList<T>
- All Implemented Interfaces:
Filtered<T>,FilterMethods<T>,ObjectList<T>,ObjectLoader<T>,Iterable<T>,Collection<T>,List<T>,SequencedCollection<T>
public class ObjectMemoryList<T extends StoredObject>
extends MemoryCache<T>
implements ObjectList<T>
-
Constructor Summary
ConstructorsConstructorDescriptionObjectMemoryList(Class<T> objectClass) ObjectMemoryList(Class<T> objectClass, boolean any) ObjectMemoryList(Class<T> objectClass, ObjectIterator<T> objects) ObjectMemoryList(Class<T> objectClass, Query query) ObjectMemoryList(Class<T> objectClass, Query query, boolean any) ObjectMemoryList(Class<T> objectClass, Iterable<Id> idList) ObjectMemoryList(Class<T> objectClass, String condition) ObjectMemoryList(Class<T> objectClass, String condition, boolean any) ObjectMemoryList(Class<T> objectClass, String condition, String orderedBy) ObjectMemoryList(Class<T> objectClass, String condition, String orderedBy, boolean any) ObjectMemoryList(Class<T> objectClass, Stream<T> objects) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanbooleanaddAll(int index, Collection<? extends T> collection) booleanaddAll(Collection<? extends T> collection) voidThis method is called whenever a filter predicate is changed.intGet the load filter.The class of the instances.intvoidload(int linkType, StoredObject master, String condition, boolean any) Load the links of the given "master" instance.voidload(ObjectIterator<T> objects) Load the given instances.voidLoad the instances created from the query.voidLoad the instances created from the list ofIds.voidLoad the instances.voidLoad the given instances.voidrefresh()voidvoidsetProcessor(Consumer<T> processor) Methods inherited from class com.storedobject.core.MemoryCache
clear, close, contains, containsAll, filter, filter, get, getComparator, getFilter, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, order, remove, remove, removeAll, removeIf, retainAll, set, size, size, sizeAll, sort, stream, streamAll, subList, toArray, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface com.storedobject.core.Filtered
filter, filter, getComparator, getFilter, order, size, size, sizeAll, stream, streamAllMethods inherited from interface com.storedobject.core.FilterMethods
getEffectiveCondition, getFilterCondition, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setLoadFilter, setLoadFilter, setViewFilter, setViewFilterMethods inherited from interface java.util.List
addFirst, addLast, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArrayMethods inherited from interface com.storedobject.core.ObjectList
clear, close, idStream, idStreamAll, isEmptyMethods inherited from interface com.storedobject.core.ObjectLoader
applyFilter, canContain, getAllowAny, getLinkType, getMaster, getOrderBy, isAllowAny, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, load, reload, setLinkType, setLinkType, setMaster, setMaster, setOrderBy, setOrderBy, size
-
Constructor Details
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
ObjectMemoryList
-
-
Method Details
-
load
Description copied from interface:ObjectLoaderLoad the instances. Current "load filter" if set will be applied. If "master" is already set, "links" of the "master" will be loaded.- Specified by:
loadin 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
Description copied from interface:ObjectLoaderLoad the links of the given "master" instance. Current "load filter" if set will be applied. The order will be determined by the return value ofObjectLoader.getOrderBy().- Specified by:
loadin interfaceObjectLoader<T extends StoredObject>- Parameters:
linkType- Link type.master- Master instance.condition- Filtering condition to be applied.any- Whether instanced of the subclasses to be retrieved or not.
-
load
Description copied from interface:ObjectLoaderLoad the instances created from the query. Current "load filter" if set will be applied. However,ObjectLoader.getOrderBy()result will be ignored.- Specified by:
loadin interfaceObjectLoader<T extends StoredObject>- Parameters:
query- Query from which objects to be loaded.any- Whether instanced of the subclasses to be retrieved or not.
-
load
Description copied from interface:ObjectLoaderLoad the instances created from the list ofIds. 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:
loadin interfaceObjectLoader<T extends StoredObject>- Parameters:
idList- List ofIds from which objects to be loaded.
-
load
Description copied from interface:ObjectLoaderLoad 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:
loadin interfaceObjectLoader<T extends StoredObject>- Parameters:
objects- Objects to be loaded.
-
load
Description copied from interface:ObjectLoaderLoad 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:
loadin interfaceObjectLoader<T extends StoredObject>- Parameters:
objects- Objects to be loaded.
-
applyFilterPredicate
public void applyFilterPredicate()Description copied from interface:FilterMethodsThis 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:
applyFilterPredicatein interfaceFilterMethods<T extends StoredObject>
-
getLoadFilter
Description copied from interface:FilterMethodsGet the load filter.- Specified by:
getLoadFilterin interfaceFilterMethods<T extends StoredObject>- Returns:
- Current load filter.
-
getObjectClass
Description copied from interface:ObjectLoaderThe class of the instances.- Specified by:
getObjectClassin interfaceObjectLoader<T extends StoredObject>- Returns:
- The class of the instances to load.
-
add
- Specified by:
addin interfaceObjectList<T extends StoredObject>
-
indexOf
- Specified by:
indexOfin interfaceObjectList<T extends StoredObject>
-
refresh
public void refresh()- Specified by:
refreshin interfaceObjectList<T extends StoredObject>
-
refresh
- Specified by:
refreshin interfaceObjectList<T extends StoredObject>
-
refresh
- Specified by:
refreshin interfaceObjectList<T extends StoredObject>
-
getCacheLevel
public int getCacheLevel()- Specified by:
getCacheLevelin interfaceObjectList<T extends StoredObject>
-
setLoader
-
getLoader
-
add
- Specified by:
addin interfaceCollection<T extends StoredObject>- Specified by:
addin interfaceList<T extends StoredObject>- Overrides:
addin classMemoryCache<T extends StoredObject>
-
add
- Specified by:
addin interfaceList<T extends StoredObject>- Overrides:
addin classMemoryCache<T extends StoredObject>
-
addAll
- Specified by:
addAllin interfaceCollection<T extends StoredObject>- Specified by:
addAllin interfaceList<T extends StoredObject>- Overrides:
addAllin classMemoryCache<T extends StoredObject>
-
addAll
- Specified by:
addAllin interfaceList<T extends StoredObject>- Overrides:
addAllin classMemoryCache<T extends StoredObject>
-
setProcessor
- Specified by:
setProcessorin interfaceObjectList<T extends StoredObject>
-