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:42:21 UTC
svn commit: r1134979 - in
/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph:
DirectedGraph.java domain/basic/DirectedGraphImpl.java
domain/basic/DirectedGraphWrapper.java
Author: simonetripodi
Date: Sun Jun 12 20:42:20 2011
New Revision: 1134979
URL: http://svn.apache.org/viewvc?rev=1134979&view=rev
Log:
edge's head/tail are defined in the Edge itself, graph doesn't need to expose an API to calculate them
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/DirectedGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphWrapper.java
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/DirectedGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/DirectedGraph.java?rev=1134979&r1=1134978&r2=1134979&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/DirectedGraph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/DirectedGraph.java Sun Jun 12 20:42:20 2011
@@ -51,20 +51,4 @@ public interface DirectedGraph<V extends
*/
Set<E> getOutbound( V v );
- /**
- * Returns the {@link Vertex} which originates the {@link Edge}.
- *
- * @param e the {@link Edge} which has the returned {@link Vertex} as source.
- * @return the {@link Vertex} which originates the {@link Edge}.
- */
- V getSource( E e );
-
- /**
- * Returns the {@link Vertex} which terminates the {@link Edge}.
- *
- * @param e the {@link Edge} which has the returned {@link Vertex} as target.
- * @return the {@link Vertex} which terminates the {@link Edge}.
- */
- V getTarget( E e );
-
}
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java?rev=1134979&r1=1134978&r2=1134979&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java Sun Jun 12 20:42:20 2011
@@ -90,7 +90,7 @@ public class DirectedGraphImpl<V extends
while ( e.hasNext() )
{
WE edge = e.next();
- addEdgeI( edge, dg.getSource( edge ), dg.getTarget( edge ) );
+ addEdgeI( edge, edge.getHead(), edge.getTail() );
if ( dg instanceof WeightedGraph )
{
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphWrapper.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphWrapper.java?rev=1134979&r1=1134978&r2=1134979&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphWrapper.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphWrapper.java Sun Jun 12 20:42:20 2011
@@ -21,7 +21,9 @@ package org.apache.commons.graph.domain.
import java.util.Set;
-import org.apache.commons.graph.*;
+import org.apache.commons.graph.DirectedGraph;
+import org.apache.commons.graph.Edge;
+import org.apache.commons.graph.Vertex;
/**
* Description of the Class
@@ -60,20 +62,4 @@ public class DirectedGraphWrapper<V exte
return impl.getOutbound(v);
}
- /**
- * {@inheritDoc}
- */
- public V getSource(E e)
- {
- return impl.getSource(e);
- }
-
- /**
- * {@inheritDoc}
- */
- public V getTarget(E e)
- {
- return impl.getTarget(e);
- }
-
}