You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2012/03/08 01:07:29 UTC
svn commit: r1298238 - in
/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph:
connectivity/DefaultConnectivityBuilder.java spanning/SuperVertex.java
Author: simonetripodi
Date: Thu Mar 8 00:07:28 2012
New Revision: 1298238
URL: http://svn.apache.org/viewvc?rev=1298238&view=rev
Log:
code format
Modified:
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java?rev=1298238&r1=1298237&r2=1298238&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java Thu Mar 8 00:07:28 2012
@@ -33,7 +33,8 @@ public class DefaultConnectivityBuilder<
private final G graph;
- public DefaultConnectivityBuilder(G graph) {
+ public DefaultConnectivityBuilder( G graph )
+ {
this.graph = graph;
}
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java?rev=1298238&r1=1298237&r2=1298238&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java Thu Mar 8 00:07:28 2012
@@ -57,7 +57,8 @@ class SuperVertex<V, W, WE, G extends Gr
* @param graph the underlying graph
* @param weightComparator the comparator used to sort the weighted edges
*/
- public SuperVertex( final V source, final G graph, final WeightedEdgesComparator<W, WE> weightComparator ) {
+ public SuperVertex( final V source, final G graph, final WeightedEdgesComparator<W, WE> weightComparator )
+ {
this.graph = graph;
vertices = new HashSet<V>();
@@ -66,14 +67,16 @@ class SuperVertex<V, W, WE, G extends Gr
orderedEdges = new TreeSet<WE>( weightComparator );
// add all edges for this vertex to the sorted set
- for ( final V w : graph.getConnectedVertices( source )) {
+ for ( final V w : graph.getConnectedVertices( source ) )
+ {
WE edge = graph.getEdge( source, w );
orderedEdges.add( edge );
}
}
/** {@inheritDoc} */
- public Iterator<V> iterator() {
+ public Iterator<V> iterator()
+ {
return vertices.iterator();
}
@@ -84,14 +87,18 @@ class SuperVertex<V, W, WE, G extends Gr
*
* @param other the {@link SuperVertex} to be merged into this
*/
- public void merge( final SuperVertex<V, W, WE, G> other ) {
- for ( final V v : other.vertices ) {
- vertices.add(v);
+ public void merge( final SuperVertex<V, W, WE, G> other )
+ {
+ for ( final V v : other.vertices )
+ {
+ vertices.add( v );
}
- for ( final WE edge : other.orderedEdges) {
+ for ( final WE edge : other.orderedEdges )
+ {
final VertexPair<V> pair = graph.getVertices( edge );
- if ( ! vertices.contains(pair.getHead()) || ! vertices.contains(pair.getTail()) ) {
+ if ( !vertices.contains( pair.getHead() ) || !vertices.contains( pair.getTail() ) )
+ {
orderedEdges.add( edge );
}
}
@@ -103,13 +110,16 @@ class SuperVertex<V, W, WE, G extends Gr
*
* @return the minimum weight edge or <code>null</code> if there is no edge
*/
- public WE getMinimumWeightEdge() {
+ public WE getMinimumWeightEdge()
+ {
boolean found = false;
WE edge = null;
- while ( ! found && ! orderedEdges.isEmpty() ) {
+ while ( !found && !orderedEdges.isEmpty() )
+ {
edge = orderedEdges.pollFirst();
VertexPair<V> pair = graph.getVertices( edge );
- if ( ! vertices.contains( pair.getHead() ) || ! vertices.contains( pair.getTail() ) ) {
+ if ( !vertices.contains( pair.getHead() ) || !vertices.contains( pair.getTail() ) )
+ {
found = true;
}
}