commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1301220 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/
Date Thu, 15 Mar 2012 21:46:12 GMT
Author: tn
Date: Thu Mar 15 21:46:12 2012
New Revision: 1301220

URL: http://svn.apache.org/viewvc?rev=1301220&view=rev
Log:
Improved javadoc and fixed class typo in export package.

Added:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelector.java
      - copied, changed from r1301200, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelctor.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelector.java
      - copied, changed from r1301200, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelctor.java
Removed:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelctor.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelctor.java
Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/AbstractExporter.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultNamedExportSelector.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultToStreamBuilder.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphExportException.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ToStreamBuilder.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/AbstractExporter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/AbstractExporter.java?rev=1301220&r1=1301219&r2=1301220&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/AbstractExporter.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/AbstractExporter.java
Thu Mar 15 21:46:12 2012
@@ -69,9 +69,7 @@ abstract class AbstractExporter<V extend
         catch ( Exception e )
         {
             throw new GraphExportException( e, "an error occurred while exporting graph %s
(named %s) to writer %s",
-                                            graph,
-                                            name,
-                                            writer );
+                                            graph, name, writer );
         }
         finally
         {

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultNamedExportSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultNamedExportSelector.java?rev=1301220&r1=1301219&r2=1301220&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultNamedExportSelector.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultNamedExportSelector.java
Thu Mar 15 21:46:12 2012
@@ -26,7 +26,7 @@ import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.Vertex;
 
 final class DefaultNamedExportSelector<V extends Vertex, E extends Edge, G extends Graph<V,
E>>
-    implements NamedExportSelctor<V, E, G>
+    implements NamedExportSelector<V, E, G>
 {
 
     private final G graph;
@@ -35,31 +35,40 @@ final class DefaultNamedExportSelector<V
 
     private final String name;
 
-    public DefaultNamedExportSelector( G graph, Writer writer )
+    public DefaultNamedExportSelector( final G graph, final Writer writer )
     {
         this( graph, writer, null );
     }
 
-    public DefaultNamedExportSelector( G graph, Writer writer, String name )
+    public DefaultNamedExportSelector( final G graph, final Writer writer, final String name
)
     {
         this.graph = graph;
         this.writer = writer;
         this.name = name;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void usingDotNotation()
         throws GraphExportException
     {
         new DotExporter<V, E, G>( graph, writer, name ).export();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void usingGraphMLFormat()
         throws GraphExportException
     {
         new GraphMLExporter<V, E, G>( graph, writer, name ).export();
     }
 
-    public ExportSelctor<V, E, G> withName( String name )
+    /**
+     * {@inheritDoc}
+     */
+    public ExportSelector<V, E, G> withName( final String graphName )
     {
         return new DefaultNamedExportSelector<V, E, G>( graph, writer, name );
     }

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultToStreamBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultToStreamBuilder.java?rev=1301220&r1=1301219&r2=1301220&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultToStreamBuilder.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/DefaultToStreamBuilder.java
Thu Mar 15 21:46:12 2012
@@ -36,14 +36,23 @@ public final class DefaultToStreamBuilde
     implements ToStreamBuilder<V, E, G>
 {
 
+    /** The graph to export. */
     private final G graph;
 
-    public DefaultToStreamBuilder( G graph )
+    /**
+     * Creates a new default {@link ToStreamBuilder} to export a {@link Graph}.
+     *
+     * @param graph the {@link Graph} to export
+     */
+    public DefaultToStreamBuilder( final G graph )
     {
         this.graph = graph;
     }
 
-    public NamedExportSelctor<V, E, G> to( File outputFile )
+    /**
+     * {@inheritDoc}
+     */
+    public NamedExportSelector<V, E, G> to( final File outputFile )
     {
         try
         {
@@ -55,14 +64,20 @@ public final class DefaultToStreamBuilde
         }
     }
 
-    public NamedExportSelctor<V, E, G> to( OutputStream outputStream )
+    /**
+     * {@inheritDoc}
+     */
+    public NamedExportSelector<V, E, G> to( final OutputStream outputStream )
     {
         return to( new OutputStreamWriter( checkNotNull( outputStream, "Impossibe to export
the graph in a null stream" ) ) );
     }
 
-    public NamedExportSelctor<V, E, G> to( Writer writer )
+    /**
+     * {@inheritDoc}
+     */
+    public NamedExportSelector<V, E, G> to( final Writer writer )
     {
-        writer = checkNotNull( writer, "Impossibe to export the graph in a null stream" );
+        checkNotNull( writer, "Impossibe to export the graph in a null stream" );
         return new DefaultNamedExportSelector<V, E, G>( graph, writer );
     }
 

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelector.java
(from r1301200, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelctor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelector.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelector.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelctor.java&r1=1301200&r2=1301220&rev=1301220&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelctor.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ExportSelector.java
Thu Mar 15 21:46:12 2012
@@ -23,17 +23,19 @@ import org.apache.commons.graph.Edge;
 import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.Vertex;
 
-public interface ExportSelctor<V extends Vertex, E extends Edge, G extends Graph<V,
E>>
+public interface ExportSelector<V extends Vertex, E extends Edge, G extends Graph<V,
E>>
 {
 
     /**
      * Export Graphs in <a href="http://en.wikipedia.org/wiki/DOT_language">DOT language</a>.
+     * @throws GraphExportException in case an error occurred while exporting the graph
      */
     void usingDotNotation()
         throws GraphExportException;
 
     /**
      * Export Graphs in <a href="http://graphml.graphdrawing.org/">GraphML file format</a>.
+     * @throws GraphExportException in case an error occurred while exporting the graph
      */
     void usingGraphMLFormat()
         throws GraphExportException;

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphExportException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphExportException.java?rev=1301220&r1=1301219&r2=1301220&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphExportException.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphExportException.java
Thu Mar 15 21:46:12 2012
@@ -21,13 +21,26 @@ package org.apache.commons.graph.export;
 
 import static java.lang.String.format;
 
+/**
+ * This exception is used to wrap any {@link Exception} that occurs while exporting a
+ * {@link Graph} instance.
+ */
 public final class GraphExportException
     extends Exception
 {
 
+    /** The serial version UID. */
     private static final long serialVersionUID = 1L;
 
-    public GraphExportException( Throwable cause, String messagePattern, Object...messageArguments
)
+    /**
+     * Constructs a new graph exception with the specified detail message.
+     *
+     * @param cause the cause
+     * @param messagePattern the error message text pattern
+     * @param messageArguments arguments referenced by the format specifiers in the format
string
+     * @see java.lang.String#format(String, Object...)
+     */
+    public GraphExportException( Throwable cause, String messagePattern, Object... messageArguments
)
     {
         super( format( messagePattern, messageArguments ), cause );
     }

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelector.java
(from r1301200, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelctor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelector.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelector.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelctor.java&r1=1301200&r2=1301220&rev=1301220&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelctor.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/NamedExportSelector.java
Thu Mar 15 21:46:12 2012
@@ -23,10 +23,16 @@ import org.apache.commons.graph.Edge;
 import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.Vertex;
 
-public interface NamedExportSelctor<V extends Vertex, E extends Edge, G extends Graph<V,
E>>
-    extends ExportSelctor<V, E, G>
+public interface NamedExportSelector<V extends Vertex, E extends Edge, G extends Graph<V,
E>>
+    extends ExportSelector<V, E, G>
 {
 
-    ExportSelctor<V, E, G> withName( String name );
+    /**
+     * Use the given name when exporting the {@link Graph} to a resource.
+     *
+     * @param name the name to identify the {@link Graph}
+     * @return the graph export format selector
+     */
+    ExportSelector<V, E, G> withName( String name );
 
 }

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ToStreamBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ToStreamBuilder.java?rev=1301220&r1=1301219&r2=1301220&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ToStreamBuilder.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/ToStreamBuilder.java
Thu Mar 15 21:46:12 2012
@@ -34,24 +34,24 @@ public interface ToStreamBuilder<V exten
      * Export the input Graph to a {@link File}.
      *
      * @param outputFile the file where exporting the Graph to
-     * @return
+     * @return the graph export format selector
      */
-    NamedExportSelctor<V, E, G> to( File outputFile );
+    NamedExportSelector<V, E, G> to( File outputFile );
 
     /**
      * Export the input Graph to an {@link OutputStream}.
      *
      * @param outputStream the output stream where exporting the Graph to
-     * @return
+     * @return the graph export format selector
      */
-    NamedExportSelctor<V, E, G> to( OutputStream outputStream );
+    NamedExportSelector<V, E, G> to( OutputStream outputStream );
 
     /**
      * Export the input Graph to a {@link Writer}.
      *
      * @param writer the writer where exporting the Graph to
-     * @return
+     * @return the graph export format selector
      */
-    NamedExportSelctor<V, E, G> to( Writer writer );
+    NamedExportSelector<V, E, G> to( Writer writer );
 
 }



Mime
View raw message