Class DelegatingRowAttributeLoader<T,L extends RowAttributeLoader<T>>
- All Implemented Interfaces:
AttributeLoader<T>,RowAttributeLoader<T>
- Direct Known Subclasses:
DelegatingAggregateAttributeLoader,DelegatingPropagateAttributeLoader,DelegatingScanningAttributeLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAllows the loader to declare dependency on the whole forest.voidpreload(LongSet rowIds, ItemForest forest, AttributeContext context) Optional method to perform any bulk actions on a set of rows before the loading function is called for each row.Methods inherited from class DelegatingAttributeLoader
delegate, getAttributeDependencies, getAttributeSpec, getCachingStrategy, getContextDependencies, getGlobalTrail, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AttributeLoader
getAttributeDependencies, getAttributeSpec, getCachingStrategy, getContextDependencies, getGlobalTrail
-
Constructor Details
-
DelegatingRowAttributeLoader
-
-
Method Details
-
preload
public void preload(@NotNull LongSet rowIds, @NotNull ItemForest forest, @NotNull AttributeContext context) Description copied from interface:RowAttributeLoaderOptional method to perform any bulk actions on a set of rows before the loading function is called for each row.
The results of the preloading should be stored using
AttributeContext.putObject(java.lang.Object, java.lang.Object). Do not store the preloading results as loader's instance fields! All loaders should be stateless.Note that this method may be called several times during a single loading operation, for arbitrary sets of rows, including those that were already pre-loaded. Be careful not to overwrite one execution's result with another's.
The loader's dependencies may not be loaded at the time of the call. In fact, there's no way to access the dependency values.
Note that
rowIdswill never contain the super-root row id (-1), even if the value for it is about to be loaded. SeeSuperRootRowfor details about the super-root.- Specified by:
preloadin interfaceRowAttributeLoader<T>- Parameters:
rowIds- set of row IDs for which attribute values are neededforest- forest for which attribute values are being loadedcontext- loading context
-
isWholeForestDependent
public boolean isWholeForestDependent()Description copied from interface:RowAttributeLoaderAllows the loader to declare dependency on the whole forest. In that case, the value loaded might depend on the forest and dependencies for the current row. (No dependencies on other values.)
The effect of such declaration is that the values of this attribute, as well as any other values depending on them, will be invalidated as soon as there's any forest or item changes.
You should almost never override this method. Introducing a whole-forest attribute takes toll on application performance.
- Specified by:
isWholeForestDependentin interfaceRowAttributeLoader<T>- Returns:
- true if the attribute is whole forest-dependent
-