Skip to content
Snippets Groups Projects
Commit f3c30b10 authored by Peter Wagenhuber's avatar Peter Wagenhuber
Browse files

getpathlen as static methods of nloc since we're missing a path class

parent 47740e0a
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ public class Nloc {
// return pump;
//}
public int getPayloadPathlength(List<Channel> path) {
public static int getPayloadPathlength(List<Channel> path) {
int len = 0;
for (Channel ch: path) {
len += ch.getPSteps();
......@@ -109,7 +109,7 @@ public class Nloc {
return len;
}
public int getHeaderPathlength(List<Channel> path) {
public static int getHeaderPathlength(List<Channel> path) {
int len = 0;
for (Channel ch: path) {
len += ch.getHSteps();
......
......@@ -30,6 +30,8 @@ public class TestNloc {
}
public static void printPath(List<Channel> path) {
System.out.println("Pathlength Payload: " + Nloc.getPayloadPathlength(path));
System.out.println("Pathlength Header: " + Nloc.getHeaderPathlength(path));
for (Channel ch : path) {
if (path.indexOf(ch) == (path.size() - 1)) {
System.out.print(ch.getName());
......@@ -38,6 +40,7 @@ public class TestNloc {
}
}
System.out.println("");
System.out.println("");
}
public static void printPaths(List<List<Channel>> pathlist) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment