Skip to content

Commit 172b1d2

Browse files
committed
Cleanup
1 parent 147d5b6 commit 172b1d2

12 files changed

+91
-134
lines changed

.classpath

+17
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,22 @@
2323
<attribute name="maven.pomderived" value="true"/>
2424
</attributes>
2525
</classpathentry>
26+
<classpathentry kind="src" path="target/generated-sources/annotations">
27+
<attributes>
28+
<attribute name="optional" value="true"/>
29+
<attribute name="maven.pomderived" value="true"/>
30+
<attribute name="ignore_optional_problems" value="true"/>
31+
<attribute name="m2e-apt" value="true"/>
32+
</attributes>
33+
</classpathentry>
34+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
35+
<attributes>
36+
<attribute name="optional" value="true"/>
37+
<attribute name="maven.pomderived" value="true"/>
38+
<attribute name="ignore_optional_problems" value="true"/>
39+
<attribute name="m2e-apt" value="true"/>
40+
<attribute name="test" value="true"/>
41+
</attributes>
42+
</classpathentry>
2643
<classpathentry kind="output" path="target/classes"/>
2744
</classpath>
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.apt.aptEnabled=false

.settings/org.eclipse.jdt.core.prefs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Tue May 08 11:52:13 IST 2018
2-
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
3-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
41
eclipse.preferences.version=1
5-
org.eclipse.jdt.core.compiler.source=1.8
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
63
org.eclipse.jdt.core.compiler.compliance=1.8
4+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5+
org.eclipse.jdt.core.compiler.processAnnotations=disabled
6+
org.eclipse.jdt.core.compiler.release=disabled
7+
org.eclipse.jdt.core.compiler.source=1.8

src/graph/apps/BFS.java

+7-14
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,17 @@
66
import graph.models.Graph;
77
import graph.models.Vertex;
88

9-
// TODO: Auto-generated Javadoc
109
/**
11-
* The Class BFS.
10+
* BFS.
1211
*
13-
* @param <T>
14-
* the generic type
12+
* @param <T> the generic type
1513
*/
1614
public class BFS<T, W> {
1715

1816
/**
1917
* Search.
2018
*
21-
* @param graph
22-
* the graph
19+
* @param graph the graph
2320
*/
2421
public BFS(Graph<T, W> graph) {
2522
for (Vertex<T> vertex : graph.getAllVertices()) {
@@ -54,10 +51,8 @@ public BFS(Graph<T, W> graph) {
5451
/**
5552
* Prints the path.
5653
*
57-
* @param source
58-
* the source
59-
* @param target
60-
* the target
54+
* @param source the source
55+
* @param target the target
6156
*/
6257
public void printPath(Vertex<T> source, Vertex<T> target) {
6358
System.out.println("Printing Path Between " + source + " and " + target);
@@ -68,10 +63,8 @@ public void printPath(Vertex<T> source, Vertex<T> target) {
6863
/**
6964
* Prints the.
7065
*
71-
* @param source
72-
* the source
73-
* @param target
74-
* the target
66+
* @param source the source
67+
* @param target the target
7568
*/
7669
private void print(Vertex<T> source, Vertex<T> target) {
7770
if (target == source) {

src/graph/apps/DFS.java

+6-12
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import graph.models.Graph;
44
import graph.models.Vertex;
55

6-
// TODO: Auto-generated Javadoc
76
/**
8-
* The Class DFS.
7+
* The DFS.
98
*
10-
* @param <T>
11-
* the generic type
9+
* @param <T> the generic type
1210
*/
1311
public class DFS<T, W> {
1412

@@ -17,8 +15,7 @@ public class DFS<T, W> {
1715
/**
1816
* Instantiates a new dfs.
1917
*
20-
* @param graph
21-
* the graph
18+
* @param graph the graph
2219
*/
2320
public DFS(Graph<T, W> graph) {
2421
for (Vertex<T> vertex : graph.getAllVertices()) {
@@ -37,12 +34,9 @@ public DFS(Graph<T, W> graph) {
3734
/**
3835
* Visit.
3936
*
40-
* @param graph
41-
* the graph
42-
* @param u
43-
* the vertex
44-
* @param time
45-
* the time
37+
* @param graph the graph
38+
* @param u the vertex
39+
* @param time the time
4640
*/
4741
public void visit(Graph<T, W> graph, Vertex<T> u) {
4842
time = time + 1;

src/graph/apps/Kruskal.java

+11
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,23 @@
1414
import graph.models.Graph;
1515
import graph.models.Vertex;
1616

17+
/**
18+
* Kruskal
19+
*
20+
* @param <T> the generic type
21+
* @param <W> the generic type
22+
*/
1723
public class Kruskal<T, W extends Comparable<W>> {
1824

1925
Graph<T, W> graph;
2026

2127
Map<Vertex<T>, ForestElement<T>> vertexForestElementMap = new HashMap<>();
2228

29+
/**
30+
* Build
31+
*
32+
* @param graph the graph
33+
*/
2334
public void build(Graph<T, W> graph) {
2435
DisjointSet<ForestElement<T>> disjointSet = new DisjoinSetForest<>();
2536

src/graph/apps/Prim.java

+18
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@
77
import graph.models.Graph;
88
import graph.models.Vertex;
99

10+
/**
11+
* Prim
12+
*
13+
* @param <T> the generic type
14+
*/
1015
public class Prim<T> {
1116

17+
/**
18+
* Build
19+
*
20+
* @param graph the graph
21+
*/
1222
public void build(Graph<T, Integer> graph) {
1323
for (Vertex<T> vertex : graph.getAllVertices()) {
1424
vertex.setParent(null);
@@ -40,6 +50,14 @@ public void build(Graph<T, Integer> graph) {
4050
}
4151
}
4252

53+
/**
54+
* Weight.
55+
*
56+
* @param graph the graph
57+
* @param u the u
58+
* @param v the v
59+
* @return the int
60+
*/
4361
private int weight(Graph<T, Integer> graph, Vertex<T> u, Vertex<T> v) {
4462
return graph.getEdge(u, v).getWeight();
4563
}

src/graph/apps/SCC.java

+7-13
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
import graph.models.Graph;
1010
import graph.models.Vertex;
1111

12-
// TODO: Auto-generated Javadoc
1312
/**
14-
* The Class DFS.
13+
* SCC
1514
*
16-
* @param <T>
17-
* the generic type
15+
* @param <T> the generic type
1816
*/
1917
public class SCC<T, W> {
2018

@@ -23,10 +21,9 @@ public class SCC<T, W> {
2321
List<LinkedList<Vertex<T>>> sccS = new ArrayList<>();
2422

2523
/**
26-
* Instantiates a new dfs.
24+
* Instantiates a new scc.
2725
*
28-
* @param graph
29-
* the graph
26+
* @param graph the graph
3027
*/
3128
public SCC(Graph<T, W> graph) {
3229

@@ -61,13 +58,10 @@ public SCC(Graph<T, W> graph) {
6158
/**
6259
* Visit.
6360
*
64-
* @param graphT
65-
* the graph
66-
* @param u
67-
* the vertex
61+
* @param graphT the graph
62+
* @param u the vertex
6863
* @param scc
69-
* @param time
70-
* the time
64+
* @param time the time
7165
*/
7266
public void visit(Graph<T, W> graphT, Vertex<T> u, List<Vertex<T>> scc) {
7367
scc.add(u);

src/graph/apps/TopologicalSort.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
import graph.models.Graph;
77
import graph.models.Vertex;
88

9-
// TODO: Auto-generated Javadoc
109
/**
11-
* The Class DFS.
10+
* Topological Sort
1211
*
1312
* @param <T>
1413
* the generic type

src/graph/models/Edge.java

+3-61
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22

33
import java.util.Objects;
44

5-
// TODO: Auto-generated Javadoc
65
/**
7-
* The Class Edge.
6+
* The Edge.
87
*
9-
* @param <T>
10-
* the generic type
11-
* @param <W>
12-
* the generic type
8+
* @param <T> the generic type
9+
* @param <W> the generic type
1310
*/
1411
public class Edge<T, W> {
1512

@@ -23,97 +20,42 @@ public class Edge<T, W> {
2320

2421
int capacity;
2522

26-
/**
27-
* Gets the source.
28-
*
29-
* @return the source
30-
*/
3123
public Vertex<T> getSource() {
3224
return source;
3325
}
3426

35-
/**
36-
* Sets the source.
37-
*
38-
* @param source
39-
* the new source
40-
*/
4127
public void setSource(Vertex<T> source) {
4228
this.source = source;
4329
}
4430

45-
/**
46-
* Gets the destination.
47-
*
48-
* @return the destination
49-
*/
5031
public Vertex<T> getDestination() {
5132
return destination;
5233
}
5334

54-
/**
55-
* Sets the destination.
56-
*
57-
* @param destination
58-
* the new destination
59-
*/
6035
public void setDestination(Vertex<T> destination) {
6136
this.destination = destination;
6237
}
6338

64-
/**
65-
* Gets the weight.
66-
*
67-
* @return the weight
68-
*/
6939
public W getWeight() {
7040
return weight;
7141
}
7242

73-
/**
74-
* Sets the weight.
75-
*
76-
* @param weight
77-
* the new weight
78-
*/
7943
public void setWeight(W weight) {
8044
this.weight = weight;
8145
}
8246

83-
/**
84-
* Sets the capacity.
85-
*
86-
* @param capacity
87-
* the new capacity
88-
*/
8947
public void setCapacity(int capacity) {
9048
this.capacity = capacity;
9149
}
9250

93-
/**
94-
* Gets the capacity.
95-
*
96-
* @return the capacity
97-
*/
9851
public int getCapacity() {
9952
return capacity;
10053
}
10154

102-
/**
103-
* Sets the flow.
104-
*
105-
* @param flow
106-
* the new flow
107-
*/
10855
public void setFlow(int flow) {
10956
this.flow = flow;
11057
}
11158

112-
/**
113-
* Gets the flow.
114-
*
115-
* @return the flow
116-
*/
11759
public int getFlow() {
11860
return flow;
11961
}

src/graph/models/GraphList.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
import java.util.Map.Entry;
1010
import java.util.Set;
1111

12-
// TODO: Auto-generated Javadoc
1312
/**
14-
* The Class GraphList.
13+
* GraphList.
1514
*
16-
* @param <T>
17-
* the generic type
18-
* @param <W>
19-
* the generic type
15+
* @param <T> the generic type
16+
* @param <W> the generic type
2017
*/
2118
public class GraphList<T, W> implements Graph<T, W> {
2219

0 commit comments

Comments
 (0)