public abstract class TraverseLib extends Object
Constructor and Description |
---|
TraverseLib() |
Modifier and Type | Method and Description |
---|---|
static <Id> Iterable<Id> |
idIterable(boolean depthFirst,
boolean inclusive,
com.google.common.collect.ImmutableList<Id> startIds,
LambdaLib.Fn1<Id,List<Id>> expand)
Generic digraph traversal as an id iterable.
|
static <Id> Iterator<Id> |
idIterator(boolean depthFirst,
boolean inclusive,
com.google.common.collect.ImmutableList<Id> startIds,
LambdaLib.Fn1<Id,List<Id>> expand)
Generic digraph traversal as an id iterator.
|
static <Id,Node> Iterable<Node> |
nodeIterable(boolean depthFirst,
boolean inclusive,
com.google.common.collect.ImmutableList<Id> startIds,
LambdaLib.Fn1<Node,List<Id>> expand,
LambdaLib.Fn1<Id,Node> lookup)
Generic digraph traversal as a node iterable.
|
static <Id,Node> Iterator<Node> |
nodeIterator(boolean depthFirst,
boolean inclusive,
com.google.common.collect.ImmutableList<Id> startIds,
LambdaLib.Fn1<Node,List<Id>> expand,
LambdaLib.Fn1<Id,Node> lookup)
Generic digraph traversal as a node iterator.
|
public static <Id> Iterable<Id> idIterable(boolean depthFirst, boolean inclusive, com.google.common.collect.ImmutableList<Id> startIds, LambdaLib.Fn1<Id,List<Id>> expand)
depthFirst
- Whether to traverse depth first or breadth first.inclusive
- Whether to include the start ids in the traversal.startId
- The initial id.expand
- A function mapping an id to the next ids.public static <Id,Node> Iterable<Node> nodeIterable(boolean depthFirst, boolean inclusive, com.google.common.collect.ImmutableList<Id> startIds, LambdaLib.Fn1<Node,List<Id>> expand, LambdaLib.Fn1<Id,Node> lookup)
depthFirst
- Whether to traverse depth first or breadth first.inclusive
- Whether to include the start nodes in the traversal.startId
- The initial id.expand
- A function mapping a node to the next ids.public static <Id> Iterator<Id> idIterator(boolean depthFirst, boolean inclusive, com.google.common.collect.ImmutableList<Id> startIds, LambdaLib.Fn1<Id,List<Id>> expand)
depthFirst
- Whether to traverse depth first or breadth first.inclusive
- Whether to include the start ids in the traversal.startId
- The initial id.expand
- A function mapping an id to the next ids.public static <Id,Node> Iterator<Node> nodeIterator(boolean depthFirst, boolean inclusive, com.google.common.collect.ImmutableList<Id> startIds, LambdaLib.Fn1<Node,List<Id>> expand, LambdaLib.Fn1<Id,Node> lookup)
depthFirst
- Whether to traverse depth first or breadth first.inclusive
- Whether to include the start nodes in the traversal.startId
- The initial id.expand
- A function mapping a node to the next ids.Copyright © 2014. All rights reserved.