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 22:34:46 UTC
svn commit: r1134976 -
/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Edge.java
Author: simonetripodi
Date: Sun Jun 12 20:34:46 2011
New Revision: 1134976
URL: http://svn.apache.org/viewvc?rev=1134976&view=rev
Log:
by definition, an edge is the link that connect a pair of vertices
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Edge.java
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Edge.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Edge.java?rev=1134976&r1=1134975&r2=1134976&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Edge.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Edge.java Sun Jun 12 20:34:46 2011
@@ -20,8 +20,30 @@ package org.apache.commons.graph;
*/
/**
- * An Edge is the link that connect a pair of {@link Vertex}.
+ * An {@code Edge} is the link that connect a pair of {@link Vertex}.
+ *
+ * A {@link Graph} in which {@link Edge}s have no orientation, {@link Vertex} members are not ordered pairs.
+ *
+ * In a {@link DirectedGraph}, {@link Edge}s have orientation, so relation expressed by the {@link Edge} has to be
+ * intended from {@link #getHead()} to {@link #getTail()}.
+ *
+ * @param <V> the Graph vertices type
*/
-public interface Edge
+public interface Edge<V extends Vertex>
{
+
+ /**
+ * Return the head of this edge.
+ *
+ * @return the head of this edge.
+ */
+ V getHead();
+
+ /**
+ * Return the tail of this edge.
+ *
+ * @return the tail of this edge.
+ */
+ V getTail();
+
}