Class DefaultTraversalStrategies
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<TraversalStrategy<?>>
,TraversalStrategies
public class DefaultTraversalStrategies extends Object implements TraversalStrategies
- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies
TraversalStrategies.GlobalCache
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<TraversalStrategy<?>>
traversalStrategies
-
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies
STRATEGY_CATEGORIES
-
-
Constructor Summary
Constructors Constructor Description DefaultTraversalStrategies()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TraversalStrategies
addStrategies(TraversalStrategy<?>... strategies)
Add all the providedTraversalStrategy
instances to the current collection.DefaultTraversalStrategies
clone()
<T extends TraversalStrategy>
Optional<T>getStrategy(Class<T> traversalStrategyClass)
Return theTraversalStrategy
instance associated with the provided class.Iterator<TraversalStrategy<?>>
iterator()
Return anIterator
of theTraversalStrategy
instances.TraversalStrategies
removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)
Remove all the providedTraversalStrategy
classes from the current collection.List<TraversalStrategy<?>>
toList()
Return an immutable list of theTraversalStrategy
instances.String
toString()
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
traversalStrategies
protected Set<TraversalStrategy<?>> traversalStrategies
-
-
Method Detail
-
addStrategies
public TraversalStrategies addStrategies(TraversalStrategy<?>... strategies)
Description copied from interface:TraversalStrategies
Add all the providedTraversalStrategy
instances to the current collection. When all the provided strategies have been added, the collection is resorted. If a strategy class is found to already be defined, it is removed and replaced by the newly added one.- Specified by:
addStrategies
in interfaceTraversalStrategies
- Parameters:
strategies
- the traversal strategies to add- Returns:
- the newly updated/sorted traversal strategies collection
-
removeStrategies
public TraversalStrategies removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)
Description copied from interface:TraversalStrategies
Remove all the providedTraversalStrategy
classes from the current collection. When all the provided strategies have been removed, the collection is resorted.- Specified by:
removeStrategies
in interfaceTraversalStrategies
- Parameters:
strategyClasses
- the traversal strategies to remove by their class- Returns:
- the newly updated/sorted traversal strategies collection
-
toList
public List<TraversalStrategy<?>> toList()
Description copied from interface:TraversalStrategies
Return an immutable list of theTraversalStrategy
instances.- Specified by:
toList
in interfaceTraversalStrategies
-
iterator
public Iterator<TraversalStrategy<?>> iterator()
Description copied from interface:TraversalStrategies
Return anIterator
of theTraversalStrategy
instances.- Specified by:
iterator
in interfaceIterable<TraversalStrategy<?>>
- Specified by:
iterator
in interfaceTraversalStrategies
-
getStrategy
public <T extends TraversalStrategy> Optional<T> getStrategy(Class<T> traversalStrategyClass)
Description copied from interface:TraversalStrategies
Return theTraversalStrategy
instance associated with the provided class.- Specified by:
getStrategy
in interfaceTraversalStrategies
- Type Parameters:
T
- the strategy class type- Parameters:
traversalStrategyClass
- the class of the strategy to get- Returns:
- an optional containing the strategy instance or not
-
clone
public DefaultTraversalStrategies clone()
- Specified by:
clone
in interfaceTraversalStrategies
- Overrides:
clone
in classObject
-
-