commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1299137 - /commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/
Date Sat, 10 Mar 2012 01:50:44 GMT
Author: simonetripodi
Date: Sat Mar 10 01:50:44 2012
New Revision: 1299137

URL: http://svn.apache.org/viewvc?rev=1299137&view=rev
Log:
used generic types extensions for Vertices/Edges arguments

Modified:
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultGrapher.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultHeadVertexConnector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultTailVertexConnector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/GraphConnector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/HeadVertexConnector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/TailVertexConnector.java

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultGrapher.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultGrapher.java?rev=1299137&r1=1299136&r2=1299137&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultGrapher.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultGrapher.java
Sat Mar 10 01:50:44 2012
@@ -34,17 +34,17 @@ final class DefaultGrapher<V, E>
         this.graph = graph;
     }
 
-    public V addVertex( V vertex )
+    public <N extends V> N addVertex( N node )
     {
-        vertex = checkNotNull( vertex, "Null vertex not admitted" );
-        graph.addVertex( vertex );
-        return vertex;
+        node = checkNotNull( node, "Null vertex not admitted" );
+        graph.addVertex( node );
+        return node;
     }
 
-    public HeadVertexConnector<V, E> addEdge( E edge )
+    public <A extends E> HeadVertexConnector<V, E> addEdge( A arc )
     {
-        edge = checkNotNull( edge, "Null edge not admitted" );
-        return new DefaultHeadVertexConnector<V, E>( graph, edge );
+        arc = checkNotNull( arc, "Null edge not admitted" );
+        return new DefaultHeadVertexConnector<V, E>( graph, arc );
     }
 
 }

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultHeadVertexConnector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultHeadVertexConnector.java?rev=1299137&r1=1299136&r2=1299137&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultHeadVertexConnector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultHeadVertexConnector.java
Sat Mar 10 01:50:44 2012
@@ -37,7 +37,7 @@ final class DefaultHeadVertexConnector<V
         this.edge = edge;
     }
 
-    public TailVertexConnector<V, E> from( V head )
+    public <H extends V> TailVertexConnector<V, E> from( H head )
     {
         head = checkNotNull( head, "Null head vertex not admitted" );
         return new DefaultTailVertexConnector<V, E>( graph, edge, head );

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultTailVertexConnector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultTailVertexConnector.java?rev=1299137&r1=1299136&r2=1299137&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultTailVertexConnector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/DefaultTailVertexConnector.java
Sat Mar 10 01:50:44 2012
@@ -40,7 +40,7 @@ final class DefaultTailVertexConnector<V
         this.head = head;
     }
 
-    public void to( V tail )
+    public <T extends V> void to( T tail )
     {
         tail = checkNotNull( tail, "Null tail vertex not admitted" );
         graph.addEdge( head, edge, tail );

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/GraphConnector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/GraphConnector.java?rev=1299137&r1=1299136&r2=1299137&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/GraphConnector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/GraphConnector.java
Sat Mar 10 01:50:44 2012
@@ -23,8 +23,8 @@ package org.apache.commons.graph.builder
 public interface GraphConnector<V, E>
 {
 
-    V addVertex( V vertex );
+    <N extends V> N addVertex( N node );
 
-    HeadVertexConnector<V, E> addEdge( E edge );
+    <A extends E> HeadVertexConnector<V, E> addEdge( A arc );
 
 }

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/HeadVertexConnector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/HeadVertexConnector.java?rev=1299137&r1=1299136&r2=1299137&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/HeadVertexConnector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/HeadVertexConnector.java
Sat Mar 10 01:50:44 2012
@@ -23,6 +23,6 @@ package org.apache.commons.graph.builder
 public interface HeadVertexConnector<V, E>
 {
 
-    TailVertexConnector<V, E> from( V head );
+    <H extends V> TailVertexConnector<V, E> from( H head );
 
 }

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/TailVertexConnector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/TailVertexConnector.java?rev=1299137&r1=1299136&r2=1299137&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/TailVertexConnector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/builder/TailVertexConnector.java
Sat Mar 10 01:50:44 2012
@@ -23,6 +23,6 @@ package org.apache.commons.graph.builder
 public interface TailVertexConnector<V, E>
 {
 
-    void to( V tail );
+    <T extends V> void to( T tail );
 
 }



Mime
View raw message