jetbrains.buildServer.util.graph
Class VcsDAGs

java.lang.Object
  extended by jetbrains.buildServer.util.graph.VcsDAGs

public class VcsDAGs
extends java.lang.Object

Author:
dmitry.neverov

Constructor Summary
VcsDAGs()
           
 
Method Summary
static DAG<java.lang.Long> addEdges(DAG<java.lang.Long> dag, java.util.Collection<? extends com.intellij.openapi.util.Pair<java.lang.Long,java.lang.Long>> edges)
          Returns DAG that contains edges from given DAG and specified additional edges.
static DAG<java.lang.Long> addNodes(DAG<java.lang.Long> dag, java.util.List<java.lang.Long> nodes)
           
static DAG<java.lang.Long> createFromEdges(java.util.Collection<? extends com.intellij.openapi.util.Pair<java.lang.Long,java.lang.Long>> edges)
          Returns DAG created from collection of edges
static DAG<java.lang.Long> createLinearDag(java.util.List<java.lang.Long> nodes)
          Returns linear DAG created from given nodes
static DAG<java.lang.Long> emptyDAG()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VcsDAGs

public VcsDAGs()
Method Detail

emptyDAG

@NotNull
public static DAG<java.lang.Long> emptyDAG()

createFromEdges

@NotNull
public static DAG<java.lang.Long> createFromEdges(@NotNull
                                                          java.util.Collection<? extends com.intellij.openapi.util.Pair<java.lang.Long,java.lang.Long>> edges)
Returns DAG created from collection of edges

Type Parameters:
T - type of DAG elements
Parameters:
edges - edges of DAG
Returns:
see above

createLinearDag

public static DAG<java.lang.Long> createLinearDag(@NotNull
                                                  java.util.List<java.lang.Long> nodes)
Returns linear DAG created from given nodes

Parameters:
nodes - nodes for dag, children nodes should come first
Returns:

addEdges

@NotNull
public static DAG<java.lang.Long> addEdges(@NotNull
                                                   DAG<java.lang.Long> dag,
                                                   @NotNull
                                                   java.util.Collection<? extends com.intellij.openapi.util.Pair<java.lang.Long,java.lang.Long>> edges)
Returns DAG that contains edges from given DAG and specified additional edges. Method assumes (but doesn't check) that new edges do not add parents to nodes in given dag, they should add only children.

Type Parameters:
T - type of DAG elements
Parameters:
dag - initial DAG
edges - additional edges
Returns:
see above

addNodes

public static DAG<java.lang.Long> addNodes(@NotNull
                                           DAG<java.lang.Long> dag,
                                           @NotNull
                                           java.util.List<java.lang.Long> nodes)