org.jetbrains.kotlin.utils
Class DFS

java.lang.Object
  extended by org.jetbrains.kotlin.utils.DFS

public class DFS
extends java.lang.Object


Nested Class Summary
static class DFS.AbstractNodeHandler<N,R>
           
static class DFS.CollectingNodeHandler<N,R,C extends java.lang.Iterable<R>>
           
static interface DFS.Neighbors<N>
           
static interface DFS.NodeHandler<N,R>
           
static class DFS.NodeHandlerWithListResult<N,R>
           
static class DFS.TopologicalOrder<N>
           
static interface DFS.Visited<N>
           
static class DFS.VisitedWithSet<N>
           
 
Constructor Summary
DFS()
           
 
Method Summary
static
<N,R> R
dfs(java.util.Collection<N> nodes, DFS.Neighbors<N> neighbors, DFS.NodeHandler<N,R> handler)
           
static
<N,R> R
dfs(java.util.Collection<N> nodes, DFS.Neighbors<N> neighbors, DFS.Visited<N> visited, DFS.NodeHandler<N,R> handler)
           
static
<N> void
dfsFromNode(N node, DFS.Neighbors<N> neighbors, DFS.Visited<N> visited)
           
static
<N,R> R
dfsFromNode(N node, DFS.Neighbors<N> neighbors, DFS.Visited<N> visited, DFS.NodeHandler<N,R> handler)
           
static
<N> java.lang.Boolean
ifAny(java.util.Collection<N> nodes, DFS.Neighbors<N> neighbors, kotlin.jvm.functions.Function1<N,java.lang.Boolean> predicate)
           
static
<N> java.util.List<N>
topologicalOrder(java.lang.Iterable<N> nodes, DFS.Neighbors<N> neighbors)
           
static
<N> java.util.List<N>
topologicalOrder(java.lang.Iterable<N> nodes, DFS.Neighbors<N> neighbors, DFS.Visited<N> visited)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFS

public DFS()
Method Detail

dfs

public static <N,R> R dfs(@NotNull
                          java.util.Collection<N> nodes,
                          @NotNull
                          DFS.Neighbors<N> neighbors,
                          @NotNull
                          DFS.Visited<N> visited,
                          @NotNull
                          DFS.NodeHandler<N,R> handler)

dfs

public static <N,R> R dfs(@NotNull
                          java.util.Collection<N> nodes,
                          @NotNull
                          DFS.Neighbors<N> neighbors,
                          @NotNull
                          DFS.NodeHandler<N,R> handler)

ifAny

public static <N> java.lang.Boolean ifAny(@NotNull
                                          java.util.Collection<N> nodes,
                                          @NotNull
                                          DFS.Neighbors<N> neighbors,
                                          @NotNull
                                          kotlin.jvm.functions.Function1<N,java.lang.Boolean> predicate)

dfsFromNode

public static <N,R> R dfsFromNode(@NotNull
                                  N node,
                                  @NotNull
                                  DFS.Neighbors<N> neighbors,
                                  @NotNull
                                  DFS.Visited<N> visited,
                                  @NotNull
                                  DFS.NodeHandler<N,R> handler)

dfsFromNode

public static <N> void dfsFromNode(@NotNull
                                   N node,
                                   @NotNull
                                   DFS.Neighbors<N> neighbors,
                                   @NotNull
                                   DFS.Visited<N> visited)

topologicalOrder

public static <N> java.util.List<N> topologicalOrder(@NotNull
                                                     java.lang.Iterable<N> nodes,
                                                     @NotNull
                                                     DFS.Neighbors<N> neighbors,
                                                     @NotNull
                                                     DFS.Visited<N> visited)

topologicalOrder

public static <N> java.util.List<N> topologicalOrder(@NotNull
                                                     java.lang.Iterable<N> nodes,
                                                     @NotNull
                                                     DFS.Neighbors<N> neighbors)