Interface DerivedAttributeLoader<T>
- Type Parameters:
T- type of the loaded value
- All Superinterfaces:
AttributeLoader<T>
- All Known Implementing Classes:
AbstractDerivedAttributeLoader,BaseDerivedAttributeLoader,BiDerivedAttributeLoaderBuilder.BuiltBiDerivedLoader,DelegatingDerivedAttributeLoader,SimpleDerivedAttributeLoader,UniDerivedAttributeLoaderBuilder.BuiltDerivedLoader
Derived loaders calculate the attribute value based only on the attribute dependencies. The dependencies are loaded by some other loaders and may be item or row based, or they may be other derived attributes.
Values calculated by derived attribute loaders are stored in the per-item cache only if they depend on other per-item attributes, otherwise they are stored in the per-forest cache.
The loader must be a stable function, based on the dependency values. It must not depend on any other inputs, and should
provide the same result for the same inputs every time: V(row) = DERIVED(dependencies(row)).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionloadValue(DerivedAttributeContext context) Performs the loading.Methods inherited from interface AttributeLoader
getAttributeDependencies, getAttributeSpec, getCachingStrategy, getContextDependencies, getGlobalTrail
-
Method Details
-
loadValue
Performs the loading.
If the value is missing or empty, the loader should return
AttributeValue.undefined(). If for some reason this loader is not applicable for the given row, it should returnnull.- Parameters:
context- loading context- Returns:
- the calculated value
-