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/02/06 13:00:39 UTC

svn commit: r1240990 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java

Author: simonetripodi
Date: Mon Feb  6 12:00:39 2012
New Revision: 1240990

URL: http://svn.apache.org/viewvc?rev=1240990&view=rev
Log:
added missing ASL header

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java?rev=1240990&r1=1240989&r2=1240990&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java Mon Feb  6 12:00:39 2012
@@ -1,5 +1,24 @@
 package org.apache.commons.graph.spanning;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
@@ -14,7 +33,7 @@ import org.apache.commons.graph.weight.O
 /**
  * A {@link SuperVertex} is a collection of {@link Vertex} objects and is only
  * used internally by Boruvka's algorithm to find a minimum spanning tree.
- * 
+ *
  * @param <V>  the Graph vertices type
  * @param <W>  the weight type
  * @param <WE> the Graph weighted edges type
@@ -29,33 +48,33 @@ class SuperVertex<V extends Vertex, W, W
 
     /** The set of vertices combined in this {@link SuperVertex}. */
     private Set<V> vertices;
-    
+
     /** The ordered set of edges to other {@link SuperVertex} objects. */
     private TreeSet<WE> orderedEdges;
-    
+
     /**
      * Create a new {@link SuperVertex} instance with <code>source</code>
      * as start vertex.
-     * 
+     *
      * @param source the start vertex
      * @param graph the underlying graph
      * @param orderedMonoid the comparator used to sort the weighted edges
      */
     public SuperVertex( final V source, final G graph, final OM orderedMonoid ) {
         this.graph = graph;
-        
+
         vertices = new HashSet<V>();
         vertices.add( source );
-        
+
         orderedEdges = new TreeSet<WE>( new WeightedEdgesComparator<W, WE>( orderedMonoid ) );
-        
+
         // add all edges for this vertex to the sorted set
         for ( V w : graph.getConnectedVertices( source )) {
             WE edge = graph.getEdge( source, w );
             orderedEdges.add( edge );
         }
     }
-    
+
     /** {@inheritDoc} */
     public Iterator<V> iterator() {
         return vertices.iterator();
@@ -64,15 +83,15 @@ class SuperVertex<V extends Vertex, W, W
     /**
      * Merges another {@link SuperVertex} instance into this one.
      * The edges from the other {@link SuperVertex} are only added in case
-     * they are not to vertices already contained in this {@link SuperVertex}. 
-     * 
+     * they are not to vertices already contained in this {@link SuperVertex}.
+     *
      * @param other the {@link SuperVertex} to be merged into this
      */
     public void merge( final SuperVertex<V, W, WE, G, OM> other ) {
         for ( V v : other.vertices ) {
             vertices.add(v);
         }
-        
+
         for (WE edge : other.orderedEdges) {
             VertexPair<V> pair = graph.getVertices( edge );
             if ( !vertices.contains(pair.getHead()) ||
@@ -85,7 +104,7 @@ class SuperVertex<V extends Vertex, W, W
     /**
      * Returns the edge with the minimum weight to other {@link SuperVertex}
      * instances.
-     * 
+     *
      * @return the minimum weight edge
      */
     public WE getMinimumWeightEdge() {