package com.dragonheart.dijkstra;

import java.util.ArrayList;

public class DijkstraGraph {
	private ArrayList<Edge> listOfEdges;
	private ArrayList<Point> listOfPoints, sourceNodes;

	public DijkstraGraph() {
		this.listOfEdges = new ArrayList<Edge>();
		this.listOfPoints = new ArrayList<Point>();
		this.sourceNodes = new ArrayList<Point>();
	}

	public void addPoint(Point point) {
		listOfPoints.add(point);
	}

	public void addEdge(Edge edge) {
		listOfEdges.add(edge);
	}
}

@@ -55,16 +55,39 @@
 rayList;
+%0Aimport java.util.List;
 %0A%0Apublic
@@ -193,20 +193,21 @@
 , source
-Node
+Point
 s;%0A%0A%09pub
@@ -335,12 +335,13 @@
 urce
-Node
+Point
 s = 
@@ -466,24 +466,24 @@
 dge edge) %7B%0A
-
 %09%09listOfEdge
@@ -497,11 +497,544 @@
 dge);%0A%09%7D
+%0A%0A%09public void addSource(Point point, Double cost) %7B%0A%09%09if(listOfPoints.contains(point)) %7B%0A%09%09%09point.aggregateCost = cost;%0A%09%09%09sourcePoints.add(point);%0A%09%09%7D%0A%09%7D%0A%0A%09public void addSources(List%3CPoint%3E points, Double cost) %7B%0A%09%09for(Point point : points) %7B%0A%09%09%09addSource(point, cost);%0A%09%09%7D%0A%09%7D%0A%0A%09public void setSource(Point point, Double cost) %7B%0A%09%09sourcePoints = new ArrayList%3CPoint%3E();%0A%09%09addSource(point, cost);%0A%09%7D%0A%0A%09public void setSources(List%3CPoint%3E points, Double cost) %7B%0A%09%09sourcePoints = new ArrayList%3CPoint%3E();%0A%09%09addSources(points, cost);%0A%09%7D
 %0A%7D%0A

Add sources 4 different ways!