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/10 03:01:50 UTC
svn commit: r1299145 - in
/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph:
flow/ shortestpath/ spanning/ visit/
Author: simonetripodi
Date: Sat Mar 10 02:01:49 2012
New Revision: 1299145
URL: http://svn.apache.org/viewvc?rev=1299145&view=rev
Log:
used generic types extensions when used as arguments
Modified:
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFromHeadBuilder.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultToTailBuilder.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FromHeadBuilder.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/ToTailBuilder.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/DefaultVisitSourceSelector.java
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/VisitSourceSelector.java
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFromHeadBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFromHeadBuilder.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFromHeadBuilder.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFromHeadBuilder.java Sat Mar 10 02:01:49 2012
@@ -46,7 +46,7 @@ final class DefaultFromHeadBuilder<V, WE
this.weightedEdges = weightedEdges;
}
- public ToTailBuilder<V, WE, W> from( V head )
+ public <H extends V> ToTailBuilder<V, WE, W> from( H head )
{
head = checkNotNull( head, "head vertex has to be specifies when looking for the max flow" );
return new DefaultToTailBuilder<V, WE, W>( graph, weightedEdges, head );
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultToTailBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultToTailBuilder.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultToTailBuilder.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultToTailBuilder.java Sat Mar 10 02:01:49 2012
@@ -48,7 +48,7 @@ final class DefaultToTailBuilder<V, WE,
this.head = head;
}
- public MaxFlowAlgorithmSelector<V, WE, W> to( V tail )
+ public <T extends V> MaxFlowAlgorithmSelector<V, WE, W> to( T tail )
{
tail = checkNotNull( tail, "tail vertex has to be specifies when looking for the max flow" );
return new DefaultMaxFlowAlgorithmSelector<V, WE, W>( graph, weightedEdges, head, tail );
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FromHeadBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FromHeadBuilder.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FromHeadBuilder.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FromHeadBuilder.java Sat Mar 10 02:01:49 2012
@@ -28,6 +28,6 @@ public interface FromHeadBuilder<V, WE,
* @param head
* @return
*/
- ToTailBuilder<V, WE, W> from( V head );
+ <H extends V> ToTailBuilder<V, WE, W> from( H head );
}
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/ToTailBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/ToTailBuilder.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/ToTailBuilder.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/ToTailBuilder.java Sat Mar 10 02:01:49 2012
@@ -28,6 +28,6 @@ public interface ToTailBuilder<V, WE, W>
* @param tail
* @return
*/
- MaxFlowAlgorithmSelector<V, WE, W> to( V tail );
+ <T extends V> MaxFlowAlgorithmSelector<V, WE, W> to( T tail );
}
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java Sat Mar 10 02:01:49 2012
@@ -140,7 +140,7 @@ final class DefaultPathSourceSelector<V,
/**
* {@inheritDoc}
*/
- public TargetSourceSelector<V, WE, W> from( V source )
+ public <H extends V> TargetSourceSelector<V, WE, W> from( H source )
{
source = checkNotNull( source, "Shortest path can not be calculated from a null source" );
return new DefaultTargetSourceSelector<V, WE, W>( graph, weightedEdges, source );
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java Sat Mar 10 02:01:49 2012
@@ -125,7 +125,7 @@ final class DefaultTargetSourceSelector<
/**
* {@inheritDoc}
*/
- public ShortestPathAlgorithmSelector<V, WE, W> to( V target )
+ public <T extends V> ShortestPathAlgorithmSelector<V, WE, W> to( T target )
{
target = checkNotNull( target, "Shortest path can not be calculated to a null target" );
return new DefaultShortestPathAlgorithmSelector<V, WE, W>( graph, weightedEdges, source, target );
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java Sat Mar 10 02:01:49 2012
@@ -46,6 +46,6 @@ public interface PathSourceSelector<V, W
*
* @param source
*/
- TargetSourceSelector<V, WE, W> from( V source );
+ <H extends V> TargetSourceSelector<V, WE, W> from( H source );
}
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java Sat Mar 10 02:01:49 2012
@@ -46,6 +46,6 @@ public interface TargetSourceSelector<V,
*
* @param target
*/
- ShortestPathAlgorithmSelector<V, WE, W> to( V target );
+ <T extends V> ShortestPathAlgorithmSelector<V, WE, W> to( T target );
}
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java Sat Mar 10 02:01:49 2012
@@ -71,7 +71,7 @@ final class DefaultSpanningTreeSourceSel
/**
* {@inheritDoc}
*/
- public SpanningTreeAlgorithmSelector<V, W, WE> fromSource( V source )
+ public <S extends V> SpanningTreeAlgorithmSelector<V, W, WE> fromSource( S source )
{
source = checkNotNull( source, "Spanning tree cannot be calculated without expressing the source vertex" );
checkState( graph.containsVertex( source ), "Vertex %s does not exist in the Graph", source );
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java Sat Mar 10 02:01:49 2012
@@ -46,7 +46,7 @@ public interface SpanningTreeSourceSelec
* @param source the source vertex to calculate the spanning tree.
* @return the linked spanning tree algorithm builder
*/
- SpanningTreeAlgorithmSelector<V, W, WE> fromSource( V source );
+ <S extends V> SpanningTreeAlgorithmSelector<V, W, WE> fromSource( S source );
/**
* Applies the <a href="http://en.wikipedia.org/wiki/Reverse-Delete_algorithm">Reverse-Delete</a> algorithm.
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/DefaultVisitSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/DefaultVisitSourceSelector.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/DefaultVisitSourceSelector.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/DefaultVisitSourceSelector.java Sat Mar 10 02:01:49 2012
@@ -45,7 +45,7 @@ public final class DefaultVisitSourceSel
/**
* {@inheritDoc}
*/
- public VisitAlgorithmsSelector<V, E, G> from( V source )
+ public <S extends V> VisitAlgorithmsSelector<V, E, G> from( S source )
{
source = checkNotNull( source, "Impossible to visit input graph %s with null source", graph );
checkState( graph.containsVertex( source ), "Vertex %s does not exist in the Graph", source );
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/VisitSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/VisitSourceSelector.java?rev=1299145&r1=1299144&r2=1299145&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/VisitSourceSelector.java (original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/visit/VisitSourceSelector.java Sat Mar 10 02:01:49 2012
@@ -37,6 +37,6 @@ public interface VisitSourceSelector<V,
* @param source the root node the search begins from
* @return the search visit algorithm selector
*/
- VisitAlgorithmsSelector<V, E, G> from( V source );
+ <S extends V> VisitAlgorithmsSelector<V, E, G> from( S source );
}