public class ProductiveByStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
by()
and wraps it CoalesceStep
so that the result is either the initial
Traversal
argument or null
. In this way, the by()
is always "productive". This strategy
is an "optimization" but it is perhaps more of a "decoration", but it should follow
ByModulatorOptimizationStrategy
which features optimizations relevant to this one.Modifier and Type | Class and Description |
---|---|
static class |
ProductiveByStrategy.Builder |
TraversalStrategy.DecorationStrategy, TraversalStrategy.FinalizationStrategy, TraversalStrategy.OptimizationStrategy, TraversalStrategy.ProviderOptimizationStrategy, TraversalStrategy.VerificationStrategy
Modifier and Type | Field and Description |
---|---|
static String |
PRODUCTIVE_KEYS |
STRATEGY
Modifier and Type | Method and Description |
---|---|
void |
apply(Traversal.Admin<?,?> traversal) |
Set<Class<? extends TraversalStrategy.OptimizationStrategy>> |
applyPrior()
The set of strategies that must be executed before this strategy is executed.
|
static ProductiveByStrategy.Builder |
build() |
static ProductiveByStrategy |
create(org.apache.commons.configuration2.Configuration configuration) |
org.apache.commons.configuration2.Configuration |
getConfiguration()
Get the configuration representation of this strategy.
|
static ProductiveByStrategy |
instance()
Gets the standard configuration of this strategy that will apply it for all conditions.
|
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo, getTraversalCategory
applyPost
public static final String PRODUCTIVE_KEYS
public static ProductiveByStrategy create(org.apache.commons.configuration2.Configuration configuration)
public static ProductiveByStrategy instance()
build()
method in cases where there is certainty that a by()
will be productive as it will
reduce the complexity of the traversal and perhaps improve the execution of other optimizations.public Set<Class<? extends TraversalStrategy.OptimizationStrategy>> applyPrior()
TraversalStrategy
applyPrior
in interface TraversalStrategy<TraversalStrategy.OptimizationStrategy>
public void apply(Traversal.Admin<?,?> traversal)
apply
in interface TraversalStrategy<TraversalStrategy.OptimizationStrategy>
public org.apache.commons.configuration2.Configuration getConfiguration()
TraversalStrategy
getConfiguration
in interface TraversalStrategy<TraversalStrategy.OptimizationStrategy>
public static ProductiveByStrategy.Builder build()
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.