Interface ListFunction
-
- All Known Implementing Classes:
CombineStep
,ConjoinStep
,DifferenceStep
,DisjunctStep
,IntersectStep
,ProductStep
,TraversalMergeStep
public interface ListFunction
List functions are a separate paradigm for Steps as they behave in a Scope.Local manner by default. This class provides helper methods that are common amongst these steps and should be used to keep behavior consistent in terms of handling of incoming traversers and argument types.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static Collection
asCollection(Object iterable)
Turn an iterable type into a collection.static Set
asSet(Object iterable)
Turn an iterable type into a set.default Collection
convertArgumentToCollection(Object arg)
default Set
convertArgumentToSet(Object arg)
default <S,E>
CollectionconvertTraversalToCollection(Traverser.Admin<S> traverser, Traversal.Admin<S,E> traversal)
default <S,E>
SetconvertTraversalToSet(Traverser.Admin<S> traverser, Traversal.Admin<S,E> traversal)
default <S> Collection
convertTraverserToCollection(Traverser.Admin<S> traverser)
default <S> Set
convertTraverserToSet(Traverser.Admin<S> traverser)
String
getStepName()
Template method used for retrieving the implementing Step's name.
-
-
-
Method Detail
-
asCollection
static Collection asCollection(Object iterable)
Turn an iterable type into a collection. Doesn't wrap any non-iterable type into an iterable (e.g. single Object into list), but will transform one iterable type to another (e.g. array to list).- Parameters:
iterable
- an Iterable or array.- Returns:
- The iterable type as a Collection or null if argument isn't iterable.
-
asSet
static Set asSet(Object iterable)
Turn an iterable type into a set. Doesn't wrap any non-iterable type into an iterable (e.g. single Object into set), but will transform one iterable type to another (e.g. array to set).- Parameters:
iterable
- an Iterable or array.- Returns:
- The iterable type as a Collection or null if argument isn't iterable.
-
getStepName
String getStepName()
Template method used for retrieving the implementing Step's name.- Returns:
- this step's name.
-
convertArgumentToCollection
default Collection convertArgumentToCollection(Object arg)
-
convertTraverserToCollection
default <S> Collection convertTraverserToCollection(Traverser.Admin<S> traverser)
-
convertTraversalToCollection
default <S,E> Collection convertTraversalToCollection(Traverser.Admin<S> traverser, Traversal.Admin<S,E> traversal)
-
convertTraverserToSet
default <S> Set convertTraverserToSet(Traverser.Admin<S> traverser)
-
convertTraversalToSet
default <S,E> Set convertTraversalToSet(Traverser.Admin<S> traverser, Traversal.Admin<S,E> traversal)
-
-