Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.LinkedList;
- import java.util.List;
- /**
- * Created by jake on 10/13/15.
- */
- public class Node extends Object implements Comparable<Node>{
- private Coordinates value;
- private List<Node> neighbors;
- public Node(Coordinates value){
- this.value = value;
- this.neighbors = new LinkedList<Node>();
- }
- public Coordinates getValue(){
- return value;
- }
- public void addNeighbor(Node newNeighbor){
- if(!neighbors.contains(newNeighbor)){
- neighbors.add(newNeighbor);
- }
- }
- public Iterable<Node> getNeighbors(){
- return neighbors;
- //TODO FUCKING EVEYTHING
- //FUCK YOUR FUCKING COMPARABLE BULLSHIT
- }
- @Override
- public String toString(){
- String result;
- result = getValue() + ": ";
- for(Node nbr : neighbors) {
- result = result + nbr.getValue() + ", ";
- }
- return (result.substring(0, result.length()-2));
- }
- public void printDetail(){
- System.out.print("Node coordinates: ");
- for (Node nbr : neighbors) {
- System.out.print(nbr.getValue() + " ");
- }
- }
- public int compareTo(Node o){
- //TODO FUCKING EVEYTHING
- /*
- int result = this.r - o.r;
- if ( result == 0 ) result = this.c - o.c;
- return result;
- */
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement