commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <simonetrip...@apache.org>
Subject Re: 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 16:35:03 GMT
OH :( I liked the fact that commons properties were defined just once
in the Abstract impl :(

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Tue, Mar 20, 2012 at 4:14 PM,  <cs@apache.org> wrote:
> 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
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message