Skip to content
Permalink
Browse files

ServerGraph: formatting in getFlowsByPath method.

  • Loading branch information
alexscheffler committed Dec 10, 2019
1 parent 670ad88 commit b84ec5f98cfc7eecd7f15151f335e603b4e7e54f
Showing with 15 additions and 18 deletions.
  1. +15 −18 src/main/java/org/networkcalculus/dnc/network/server_graph/ServerGraph.java
@@ -759,29 +759,26 @@ public Flow getFlow(int id) throws Exception {

/**
* Finds all the flows that have exactly path p as their path.
*
* @param p
* The path which all the returned flows have.
* The path which all the returned flows have.
* @return Set of flows that have p as their path.
* @throws Exception
* If the path is null.
* If the path is null.
*/
public Set<Flow> getFlowsByPath(Path p) throws Exception {
// Throw a runtime exception if p is null.
if(p == null) {
throw new RuntimeException("Path argument for method getFlowsByPath(Path p) in ServerGraph was null.");
}
Set<Flow> result = new HashSet<Flow>();
// All the flows that start at the first server of the path p are potential candidates.
Set<Flow> flows_source_p = getFlows(p.getSource());
for(Flow f : flows_source_p)
{
if(f.getPath().equals(p))
{
result.add(f);
}
}
return result;
// Throw a runtime exception if p is null.
if(p == null) {
throw new RuntimeException("Path argument for method getFlowsByPath(Path p) in ServerGraph was null.");
}
Set<Flow> result = new HashSet<Flow>();
// All the flows that start at the first server of the path p are potential candidates.
Set<Flow> flows_source_p = getFlows(p.getSource());
for(Flow f : flows_source_p){
if(f.getPath().equals(p)){
result.add(f);
}
}
return result;
}

/**

0 comments on commit b84ec5f

Please sign in to comment.
You can’t perform that action at this time.