-
public final class treeKt
-
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>
spanningTree(Number potential)
Build a spanning tree. final <T extends Any, U extends Any> <ERROR CLASS>
spanningTreeExtended(Number potential, Function1<T, U> function, U init)
Build a spanning tree. final <T extends Any, U extends Any> U
applyOnTree(Function1<Unit, T> tree, Boolean condition, Function1<T, U> f, Function1<T, U> g)
Assuming to have a spanning tree, apply f where condition holds, g otherwise. final <E extends Any, C extends Any, U extends Any> U
descendBranch(Number potential, Function1<Boolean, Boolean> filter, Function2<Any, Any, U> f, Function2<Any, Any, U> g)
Assuming to have a spanning tree, apply f to the children of the first device where condition holds, g otherwise. final <E extends Any, C extends Any, U extends Any> U
descendBranchWithNull(Number potential, Number null, Function1<Boolean, Boolean> filter, Function2<Any, Any, U> f, Function2<Any, Any, U> g)
Assuming to have a spanning tree, apply f to the children of the first device where condition holds, g otherwise. final <E extends Any, C extends Any, U extends Any> U
ascendBranch(Number potential, Function1<Boolean, Boolean> filter, Function2<Any, Any, U> f, Function2<Any, Any, U> g)
Assuming to have a spanning tree, apply f to the father of any of the devices where condition holds, g otherwise. -
-
Method Detail
-
spanningTree
final <ERROR CLASS> spanningTree(Number potential)
Build a spanning tree.
- Parameters:
potential
- potential to be followed
-
spanningTreeExtended
final <T extends Any, U extends Any> <ERROR CLASS> spanningTreeExtended(Number potential, Function1<T, U> function, U init)
Build a spanning tree.
- Parameters:
potential
- potential to be followedfunction
- function to be applied to the parent valueinit
- initial value of the device
-
applyOnTree
final <T extends Any, U extends Any> U applyOnTree(Function1<Unit, T> tree, Boolean condition, Function1<T, U> f, Function1<T, U> g)
Assuming to have a spanning tree, apply f where condition holds, g otherwise.
- Parameters:
tree
- treecondition
- conditionf
- what to do if condition is trueg
- what to do if condition is false
-
descendBranch
final <E extends Any, C extends Any, U extends Any> U descendBranch(Number potential, Function1<Boolean, Boolean> filter, Function2<Any, Any, U> f, Function2<Any, Any, U> g)
Assuming to have a spanning tree, apply f to the children of the first device where condition holds, g otherwise.
- Parameters:
potential
- potentialfilter
- whether to execute f or g according to the parent conditionf
- what to do if condition is trueg
- what to do if condition is false
-
descendBranchWithNull
final <E extends Any, C extends Any, U extends Any> U descendBranchWithNull(Number potential, Number null, Function1<Boolean, Boolean> filter, Function2<Any, Any, U> f, Function2<Any, Any, U> g)
Assuming to have a spanning tree, apply f to the children of the first device where condition holds, g otherwise.
- Parameters:
potential
- potentialnull
- null potential valuefilter
- whether to execute f or g according to the parent conditionf
- what to do if condition is trueg
- what to do if condition is false
-
ascendBranch
final <E extends Any, C extends Any, U extends Any> U ascendBranch(Number potential, Function1<Boolean, Boolean> filter, Function2<Any, Any, U> f, Function2<Any, Any, U> g)
Assuming to have a spanning tree, apply f to the father of any of the devices where condition holds, g otherwise.
- Parameters:
potential
- potentialfilter
- whether to execute f or g according to the parent conditionf
- what to do if condition is trueg
- what to do if condition is false
-
-
-
-