Path.java

[sourcecode language=”java” wraplines=”false” collapse=”false”]
/* Author: Jourdan Bul-lalayao
* Class: Path.java
* Description: Linked list data structure to print out shortest cost paths.
*/

public class Path {

private String city;
private Path next;

public Path(String city, Path next) {
this.city = city;
this.next = next;
}

public void setCity(String city) {
this.city = city;
}

public void setNext(Path next) {
this.next = next;
}

public String getCity() {
return city;
}

public Path getNext() {
return next;
}
}
[/sourcecode]

Leave a Reply

Your email address will not be published. Required fields are marked *