Skip to content

Commit 00d41d4

Browse files
committed
Javadoc fix.
1 parent 3f3fbad commit 00d41d4

3 files changed

Lines changed: 25 additions & 19 deletions

File tree

src/main/java/com/brunomnsilva/smartgraph/graph/Digraph.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ Collection<Edge<E, V>> incidentEdges(Vertex<V> inbound)
7171
* @param outbound vertex for which to obtain the outbound edges
7272
*
7373
* @return collection of edges
74+
*
75+
* @throws InvalidVertexException if <code>outbound</code> is an invalid vertex for the graph
7476
*/
7577
Collection<Edge<E, V>> outboundEdges(Vertex<V> outbound)
7678
throws InvalidVertexException;
@@ -90,7 +92,7 @@ Collection<Edge<E, V>> outboundEdges(Vertex<V> outbound)
9092
*
9193
* @return true if they are adjacent, false otherwise.
9294
*
93-
* @exception InvalidVertexException if <code>outbound</code> or
95+
* @throws InvalidVertexException if <code>outbound</code> or
9496
* <code>inbound</code>
9597
* are invalid vertices for the graph
9698
*/
@@ -108,11 +110,11 @@ boolean areAdjacent(Vertex<V> outbound, Vertex<V> inbound)
108110
*
109111
* @return the reference for the newly created edge
110112
*
111-
* @exception InvalidVertexException if <code>outbound</code> or
113+
* @throws InvalidVertexException if <code>outbound</code> or
112114
* <code>inbound</code>
113115
* are invalid vertices for the graph
114116
*
115-
* @exception InvalidEdgeException if there already exists an edge
117+
* @throws InvalidEdgeException if there already exists an edge
116118
* containing <code>edgeElement</code>
117119
* according to the equality of
118120
* {@link Object#equals(java.lang.Object)}
@@ -133,14 +135,14 @@ Edge<E, V> insertEdge(Vertex<V> outbound, Vertex<V> inbound, E edgeElement)
133135
*
134136
* @return the reference for the newly created edge
135137
*
136-
* @exception InvalidVertexException if <code>outboundElement</code> or
138+
* @throws InvalidVertexException if <code>outboundElement</code> or
137139
* <code>inboundElement</code>
138140
* are not found in any vertices of the graph
139141
* according to the equality of
140142
* {@link Object#equals(java.lang.Object) }
141143
* method.
142144
*
143-
* @exception InvalidEdgeException if there already exists an edge
145+
* @throws InvalidEdgeException if there already exists an edge
144146
* containing <code>edgeElement</code>
145147
* according to the equality of
146148
* {@link Object#equals(java.lang.Object) }

src/main/java/com/brunomnsilva/smartgraph/graph/DigraphEdgeList.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ public class DigraphEdgeList<V, E> implements Digraph<V, E> {
4343
private final Map<V, Vertex<V>> vertices;
4444
private final Map<E, Edge<E, V>> edges;
4545

46+
/**
47+
* Default constructor that initializes an empty digraph.
48+
*/
4649
public DigraphEdgeList() {
4750
this.vertices = new HashMap<>();
4851
this.edges = new HashMap<>();
4952
}
50-
51-
53+
5254
@Override
5355
public synchronized Collection<Edge<E, V>> incidentEdges(Vertex<V> inbound) throws InvalidVertexException {
5456
checkVertex(inbound);

src/main/java/com/brunomnsilva/smartgraph/graph/Graph.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public interface Graph<V, E> {
7979
* @param v vertex for which to obtain the incident edges
8080
*
8181
* @return collection of edges
82+
*
83+
* @throws InvalidVertexException if the vertex is invalid for the graph
8284
*/
8385
Collection<Edge<E, V>> incidentEdges(Vertex<V> v)
8486
throws InvalidVertexException;
@@ -94,8 +96,8 @@ Collection<Edge<E, V>> incidentEdges(Vertex<V> v)
9496
* @param e edge connected to <code>v</code>
9597
* @return opposite vertex along <code>e</code>
9698
*
97-
* @exception InvalidVertexException if the vertex is invalid for the graph
98-
* @exception InvalidEdgeException if the edge is invalid for the graph
99+
* @throws InvalidVertexException if the vertex is invalid for the graph
100+
* @throws InvalidEdgeException if the edge is invalid for the graph
99101
*/
100102
Vertex<V> opposite(Vertex<V> v, Edge<E, V> e)
101103
throws InvalidVertexException, InvalidEdgeException;
@@ -109,7 +111,7 @@ Vertex<V> opposite(Vertex<V> v, Edge<E, V> e)
109111
*
110112
* @return true if they are adjacent, false otherwise.
111113
*
112-
* @exception InvalidVertexException if <code>u</code> or <code>v</code>
114+
* @throws InvalidVertexException if <code>u</code> or <code>v</code>
113115
* are invalid vertices for the graph
114116
*/
115117
boolean areAdjacent(Vertex<V> u, Vertex<V> v)
@@ -122,7 +124,7 @@ boolean areAdjacent(Vertex<V> u, Vertex<V> v)
122124
*
123125
* @return the reference of the newly created vertex
124126
*
125-
* @exception InvalidVertexException if there already exists a vertex
127+
* @throws InvalidVertexException if there already exists a vertex
126128
* containing <code>vElement</code>
127129
* according to the equality of
128130
* {@link Object#equals(java.lang.Object) }
@@ -142,10 +144,10 @@ Vertex<V> insertVertex(V vElement)
142144
*
143145
* @return the reference for the newly created edge
144146
*
145-
* @exception InvalidVertexException if <code>u</code> or <code>v</code>
147+
* @throws InvalidVertexException if <code>u</code> or <code>v</code>
146148
* are invalid vertices for the graph
147149
*
148-
* @exception InvalidEdgeException if there already exists an edge
150+
* @throws InvalidEdgeException if there already exists an edge
149151
* containing <code>edgeElement</code>
150152
* according to the equality of
151153
* {@link Object#equals(java.lang.Object) }
@@ -165,14 +167,14 @@ Edge<E, V> insertEdge(Vertex<V> u, Vertex<V> v, E edgeElement)
165167
*
166168
* @return the reference for the newly created edge
167169
*
168-
* @exception InvalidVertexException if <code>vElement1</code> or
170+
* @throws InvalidVertexException if <code>vElement1</code> or
169171
* <code>vElement2</code>
170172
* are not found in any vertices of the graph
171173
* according to the equality of
172174
* {@link Object#equals(java.lang.Object) }
173175
* method.
174176
*
175-
* @exception InvalidEdgeException if there already exists an edge
177+
* @throws InvalidEdgeException if there already exists an edge
176178
* containing <code>edgeElement</code>
177179
* according to the equality of
178180
* {@link Object#equals(java.lang.Object) }
@@ -189,7 +191,7 @@ Edge<E, V> insertEdge(V vElement1, V vElement2, E edgeElement)
189191
*
190192
* @return element stored at the removed vertex
191193
*
192-
* @exception InvalidVertexException if <code>v</code> is an invalid vertex for the graph
194+
* @throws InvalidVertexException if <code>v</code> is an invalid vertex for the graph
193195
*/
194196
V removeVertex(Vertex<V> v) throws InvalidVertexException;
195197

@@ -200,7 +202,7 @@ Edge<E, V> insertEdge(V vElement1, V vElement2, E edgeElement)
200202
*
201203
* @return element stored at the removed edge
202204
*
203-
* @exception InvalidEdgeException if <code>e</code> is an invalid edge for the graph.
205+
* @throws InvalidEdgeException if <code>e</code> is an invalid edge for the graph.
204206
*/
205207
E removeEdge(Edge<E, V> e) throws InvalidEdgeException;
206208

@@ -213,7 +215,7 @@ Edge<E, V> insertEdge(V vElement1, V vElement2, E edgeElement)
213215
*
214216
* @return previous element previously stored in <code>v</code>
215217
*
216-
* @exception InvalidVertexException if the vertex <code>v</code> is invalid for the graph, or;
218+
* @throws InvalidVertexException if the vertex <code>v</code> is invalid for the graph, or;
217219
* if there already exists another vertex containing
218220
* the element <code>newElement</code>
219221
* according to the equality of
@@ -231,7 +233,7 @@ Edge<E, V> insertEdge(V vElement1, V vElement2, E edgeElement)
231233
*
232234
* @return previous element previously stored in <code>e</code>
233235
*
234-
* @exception InvalidVertexException if the edge <code>e</code> is invalid for the graph, or;
236+
* @throws InvalidEdgeException if the edge <code>e</code> is invalid for the graph, or;
235237
* if there already exists another edge containing
236238
* the element <code>newElement</code>
237239
* according to the equality of

0 commit comments

Comments
 (0)