commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c.@apache.org
Subject svn commit: r1302930 - in /commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export: AbstractExporter.java DotExporter.java GraphMLExporter.java
Date Tue, 20 Mar 2012 15:14:46 GMT
Author: cs
Date: Tue Mar 20 15:14:45 2012
New Revision: 1302930

URL: http://svn.apache.org/viewvc?rev=1302930&view=rev
Log:
removed property setters (withEdgeWeights, etc) from AbstractExporter, replaced them with
protected methods (addEdgeProperty, addVertexProperty) that can be called by the concrete
implementations

Modified:
    commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/AbstractExporter.java
    commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java
    commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java

Modified: commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/AbstractExporter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/AbstractExporter.java?rev=1302930&r1=1302929&r2=1302930&view=diff
==============================================================================
--- commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/AbstractExporter.java
(original)
+++ commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/AbstractExporter.java
Tue Mar 20 15:14:45 2012
@@ -62,14 +62,6 @@ abstract class AbstractExporter<V, E, T 
         this.name = name != null ? name : G;
     }
 
-    public abstract <N extends Number> T withEdgeWeights( Mapper<E, N> edgeWeights
);
-
-    public abstract <N extends Number> T withVertexWeights( Mapper<V, N> vertexWeights
);
-
-    public abstract T withEdgeLabels( Mapper<E, String> edgeLabels );
-
-    public abstract T withVertexLabels( Mapper<V, String> vertexLabels );
-
     public final void to( File outputFile )
         throws GraphExportException
     {
@@ -168,6 +160,16 @@ abstract class AbstractExporter<V, E, T 
     {
         return writer;
     }
+    
+    protected void addVertexProperty(String propertyName, Mapper<V, ?> vertexProperty)

+    {
+    	this.vertexProperties.put(propertyName, vertexProperty);
+    }
+    
+    protected void addEdgeProperty(String propertyName, Mapper<E, ?> edgeProperty)
+    {
+    	this.edgeProperties.put(propertyName, edgeProperty);
+    }
 
     protected abstract void startSerialization()
         throws Exception;

Modified: commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java?rev=1302930&r1=1302929&r2=1302930&view=diff
==============================================================================
--- commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java
(original)
+++ commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java
Tue Mar 20 15:14:45 2012
@@ -158,28 +158,18 @@ final class DotExporter<V, E>
         }
     }
 
-    @Override
     public <N extends Number> DotExporter<V, E> withEdgeWeights( Mapper<E,
N> edgeWeights )
     {
         // TODO Auto-generated method stub
         return this;
     }
 
-    @Override
-    public <N extends Number> DotExporter<V, E> withVertexWeights( Mapper<V,
N> vertexWeights )
-    {
-        // TODO Auto-generated method stub
-        return this;
-    }
-
-    @Override
     public DotExporter<V, E> withEdgeLabels( Mapper<E, String> edgeLabels )
     {
         // TODO Auto-generated method stub
         return this;
     }
 
-    @Override
     public DotExporter<V, E> withVertexLabels( Mapper<V, String> vertexLabels
)
     {
         // TODO Auto-generated method stub

Modified: commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java?rev=1302930&r1=1302929&r2=1302930&view=diff
==============================================================================
--- commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java
(original)
+++ commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java
Tue Mar 20 15:14:45 2012
@@ -178,28 +178,24 @@ final class GraphMLExporter<V, E>
         return STRING;
     }
 
-    @Override
     public <N extends Number> GraphMLExporter<V, E> withEdgeWeights( Mapper<E,
N> edgeWeights )
     {
         // TODO Auto-generated method stub
         return this;
     }
 
-    @Override
     public <N extends Number> GraphMLExporter<V, E> withVertexWeights( Mapper<V,
N> vertexWeights )
     {
         // TODO Auto-generated method stub
         return this;
     }
 
-    @Override
     public GraphMLExporter<V, E> withEdgeLabels( Mapper<E, String> edgeLabels
)
     {
         // TODO Auto-generated method stub
         return this;
     }
 
-    @Override
     public GraphMLExporter<V, E> withVertexLabels( Mapper<V, String> vertexLabels
)
     {
         // TODO Auto-generated method stub



Mime
View raw message