Package com.marginallyclever.convenience
Class PathCalculator
java.lang.Object
com.marginallyclever.convenience.PathCalculator
PathCalculator
is a static class that can calculate the relative path between two files.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getRelativePath
(Node origin, Node goal) Return the relative path from origin to goal.static String
getRelativePath
(String origin, String goal) Return the relative path from origin to goal.
-
Constructor Details
-
PathCalculator
public PathCalculator()
-
-
Method Details
-
getRelativePath
Return the relative path from origin to goal.- Parameters:
origin
- the starting pointgoal
- the destination- Returns:
- the relative path from origin to goal
- Throws:
IllegalArgumentException
- if there is no path from origin to goal.
-
getRelativePath
Return the relative path from origin to goal.- Parameters:
origin
- the starting pointgoal
- the destination- Returns:
- the relative path from origin to goal or null if goal is null.
- Throws:
NullPointerException
- if origin is nullIllegalArgumentException
- if there is no path from origin to goal.
-