Class AbstractScanningLoader<T>
Object
AbstractAttributeLoader<T>
AbstractScanningLoader<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
AttributeLoader<T>
,MultiRowAttributeLoader<T>
,RowAttributeLoader<T>
,ScanningAttributeLoader<T>
- Direct Known Subclasses:
ScanningLongSumLoader
,ScanningNumberSumLoader
public abstract class AbstractScanningLoader<T>
extends AbstractAttributeLoader<T>
implements ScanningAttributeLoader<T>
Base class for scanning loaders that support standard options "baseLevel" and "levels".
Note that implementation relies on the fact that the value T is immutable and can be shared among multiple rows.
-
Field Summary
Fields inherited from class AbstractAttributeLoader
mySpec
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeValue<T>
carryPrecedingValueForSkippedRow
(AttributeValue<T> precedingValue) protected Integer
protected IntList
protected boolean
isAboveBaseLevel
(ScanningAttributeContext context) protected boolean
isLevelSkipped
(ScanningAttributeContext context) protected boolean
isRowSkipped
(AttributeValue<T> precedingValue, ScanningAttributeContext context) loadValue
(AttributeValue<T> precedingValue, ScanningAttributeContext context) Performs scanning loading.protected abstract T
loadValueForPassingRow
(T precedingValue, ScanningAttributeContext context) Methods inherited from class AbstractAttributeLoader
getAttributeSpec, toString
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface AttributeLoader
getAttributeDependencies, getAttributeSpec, getContextDependencies, getGlobalTrail
Methods inherited from interface MultiRowAttributeLoader
getCachingStrategy
Methods inherited from interface RowAttributeLoader
isWholeForestDependent, preload
-
Constructor Details
-
AbstractScanningLoader
-
-
Method Details
-
isLevelSkipped
-
isAboveBaseLevel
-
getBaseLevel
-
getLevelsSorted
@Nullable protected IntList getLevelsSorted() -
loadValue
@Nullable public AttributeValue<T> loadValue(@NotNull AttributeValue<T> precedingValue, @NotNull ScanningAttributeContext context) Description copied from interface:ScanningAttributeLoader
Performs scanning loading. Must be a pure function - see
ScanningAttributeLoader
.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
. (Note, however, that if multiple scanning loaders work on the same attribute, it could be tricky and lead to unexpected results.)- Specified by:
loadValue
in interfaceScanningAttributeLoader<T>
- Parameters:
precedingValue
- the value of this attribute for the immediately preceding row, orAttributeValue.undefined()
for the very first rowcontext
- loading context- Returns:
- the calculated value
-
loadValueForPassingRow
@Nullable protected abstract T loadValueForPassingRow(@Nullable T precedingValue, ScanningAttributeContext context) -
isRowSkipped
-
carryPrecedingValueForSkippedRow
-