public class Mappers extends Object
Iterable
s and Tree
s. Each method also takes as input
an ITransformer
which transforms an individual node of the iterable or the tree into a
new object of a (possibly) different type. The methods then return a new iterable or tree
containing the new objects.Constructor and Description |
---|
Mappers() |
Modifier and Type | Method and Description |
---|---|
static <T,S> Tree<S> |
conditionalMapTree(Tree<T> tree,
ITransformer<Tree<T>,S> transformer,
ITransformer<Tree<T>,Boolean> predicate) |
static <T,S> List<S> |
map(Iterable<T> enumeration,
ITransformer<T,S> f) |
static <T,S> Tree<S> |
mapTree(Tree<T> tree,
ITransformer<Tree<T>,S> transformer) |
static <T,S> Tree<S> |
mapTree(Tree<T> tree,
ITransformer<Tree<T>,S> nodeTransformer,
ITransformer<T,S> edgeTransformer) |
static <T,S> Tree<S> |
mapTreePostfix(Tree<T> tree,
ITransformer<Tree<T>,S> transformer) |
static <T,S> Tree<S> |
mapTreePostfixConditional(Tree<T> tree,
ITransformer<Tree<T>,S> transformer,
ITransformer<Tree<T>,Boolean> predicate) |
public static <T,S> List<S> map(Iterable<T> enumeration, ITransformer<T,S> f)
public static <T,S> Tree<S> mapTree(Tree<T> tree, ITransformer<Tree<T>,S> transformer)
public static <T,S> Tree<S> mapTree(Tree<T> tree, ITransformer<Tree<T>,S> nodeTransformer, ITransformer<T,S> edgeTransformer)
public static <T,S> Tree<S> conditionalMapTree(Tree<T> tree, ITransformer<Tree<T>,S> transformer, ITransformer<Tree<T>,Boolean> predicate)
public static <T,S> Tree<S> mapTreePostfix(Tree<T> tree, ITransformer<Tree<T>,S> transformer)
public static <T,S> Tree<S> mapTreePostfixConditional(Tree<T> tree, ITransformer<Tree<T>,S> transformer, ITransformer<Tree<T>,Boolean> predicate)
Copyright © 2017. All rights reserved.