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 2011/06/12 00:36:16 UTC

svn commit: r1134804 - in /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph: Path.java WeightedPath.java

Author: simonetripodi
Date: Sat Jun 11 22:36:16 2011
New Revision: 1134804

URL: http://svn.apache.org/viewvc?rev=1134804&view=rev
Log:
generified Vertex/Edge types

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Path.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Path.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Path.java?rev=1134804&r1=1134803&r2=1134804&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Path.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Path.java Sat Jun 11 22:36:16 2011
@@ -24,32 +24,35 @@ import java.util.List;
 /**
  * A {@code Path} in a {@link Graph} is a sequence of {@link Vertex} such that from each of its vertices there is an
  * {@link Edge} to the next {@link Vertex} in the sequence.
+ *
+ * @param <V> the Graph vertices type
+ * @param <E> the Graph edges type
  */
-public interface Path
+public interface Path<V extends Vertex, E extends Edge>
 {
 
     /**
      * Returns the start of the path.
      */
-    Vertex getStart();
+    V getStart();
 
     /**
      * Returns the end of the path.
      */
-    Vertex getEnd();
+    V getEnd();
 
     /**
      * getVertices() - This returns a list of Vertices, in order as they go from
      * Start to End. This includes the Start and End vertex, and will have one
      * more entry than the Edges list.
      */
-    List<Vertex> getVertices();
+    List<V> getVertices();
 
     /**
      * getEdges() - This returns a list of Edges which comprise the path. It
      * will have one less than the list of Vertices.
      */
-    List<Edge> getEdges();
+    List<E> getEdges();
 
     /**
      * size() - This returns the size of the path in terms of number of

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java?rev=1134804&r1=1134803&r2=1134804&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java Sat Jun 11 22:36:16 2011
@@ -21,9 +21,12 @@ package org.apache.commons.graph;
 
 /**
  * A {@code Path} where {@link Edge} are weighted.
+ *
+ * @param <V> the Graph vertices type
+ * @param <E> the Graph edges type
  */
-public interface WeightedPath
-    extends Path
+public interface WeightedPath<V extends Vertex, E extends Edge>
+    extends Path<V, E>
 {
 
     /**