T
- feature-input typeS
- strategy-typepublic class BoundReplaceStrategy<T extends FeatureInput,S extends ReplaceStrategy<T>> extends Object
i.e. the strategy is attached only when first needed.
This is because as the relevant parameters are not available when we need to call the constructor.
Constructor and Description |
---|
BoundReplaceStrategy(java.util.function.Function<CacheCreator,S> createStrategy) |
Modifier and Type | Method and Description |
---|---|
ReplaceStrategy<T> |
createOrReuse(FeatureList<T> features,
FeatureInitialization initialization,
SharedFeatures sharedFeatures,
Logger logger)
Creates a
ReplaceStrategy for a particular CacheCreator , or reuses any
previously-created ReplaceStrategy if it exists. |
Optional<S> |
getStrategy()
The strategy that has been bound (if it exists).
|
public BoundReplaceStrategy(java.util.function.Function<CacheCreator,S> createStrategy)
public ReplaceStrategy<T> createOrReuse(FeatureList<T> features, FeatureInitialization initialization, SharedFeatures sharedFeatures, Logger logger)
ReplaceStrategy
for a particular CacheCreator
, or reuses any
previously-created ReplaceStrategy
if it exists.features
- the features to use in the CacheCreator
, if created.initialization
- the initialization for the CacheCreator
, if created.sharedFeatures
- the shared-features for the CacheCreator
, if created.logger
- the logger.ReplaceStrategy
, reused if it already exists, otherwise newly created.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.