[Plexus-svn] SF.net SVN: plexus:[890] trunk/plexus-graph/src/test/java/com/phoenixst/ plexus
Status: Alpha
Brought to you by:
rconner
From: <rc...@us...> - 2010-09-16 15:33:33
|
Revision: 890 http://plexus.svn.sourceforge.net/plexus/?rev=890&view=rev Author: rconner Date: 2010-09-16 15:33:22 +0000 (Thu, 16 Sep 2010) Log Message: ----------- minor cleanup Modified Paths: -------------- trunk/plexus-graph/src/test/java/com/phoenixst/plexus/AbstractGraphTest.java trunk/plexus-graph/src/test/java/com/phoenixst/plexus/GraphPrinter.java Modified: trunk/plexus-graph/src/test/java/com/phoenixst/plexus/AbstractGraphTest.java =================================================================== --- trunk/plexus-graph/src/test/java/com/phoenixst/plexus/AbstractGraphTest.java 2010-09-15 22:40:39 UTC (rev 889) +++ trunk/plexus-graph/src/test/java/com/phoenixst/plexus/AbstractGraphTest.java 2010-09-16 15:33:22 UTC (rev 890) @@ -247,7 +247,7 @@ notPresentEdges = createEdgeArray( badEdges ); } - protected static Edge[] createEdgeArray( Collection< Edge > edges ) + private static Edge[] createEdgeArray( Collection< Edge > edges ) { Edge[] edgeArray = new Edge[edges.size()]; edges.toArray( edgeArray ); @@ -503,7 +503,6 @@ for( Edge edge : presentEdges ) { assertTrue( testEdges.contains( new SimpleObjectEdge( edge.getUserObject(), edge.getTail(), edge.getHead(), edge.isDirected() ) ) ); - } for( Edge edge : notPresentEdges ) { assertFalse( testEdges.contains( new SimpleObjectEdge( edge.getUserObject(), edge.getTail(), Modified: trunk/plexus-graph/src/test/java/com/phoenixst/plexus/GraphPrinter.java =================================================================== --- trunk/plexus-graph/src/test/java/com/phoenixst/plexus/GraphPrinter.java 2010-09-15 22:40:39 UTC (rev 889) +++ trunk/plexus-graph/src/test/java/com/phoenixst/plexus/GraphPrinter.java 2010-09-16 15:33:22 UTC (rev 890) @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) 1994-2005 by Phoenix Software Technologists, + * Copyright (C) 1994-2010 by Phoenix Software Technologists, * Inc. and others. All rights reserved. * * THIS PROGRAM AND DOCUMENTATION IS PROVIDED UNDER THE TERMS OF THE @@ -16,8 +16,8 @@ package com.phoenixst.plexus; import java.io.PrintStream; -import java.util.Iterator; +import com.phoenixst.plexus.Graph.Edge; import com.phoenixst.plexus.examples.CompleteBipartiteGraph; import com.phoenixst.plexus.examples.CompleteGraph; import com.phoenixst.plexus.examples.CompleteTree; @@ -33,9 +33,11 @@ /** - * A {@link Graph} printing utility. + * A {@link Graph} printing utility. * - * @author Ray A. Conner + * FIXME: Move this, it's not a test. + * + * @author rconner */ public class GraphPrinter { @@ -53,7 +55,7 @@ Traverser t = graph.traverser( node, null ); while( t.hasNext() ) { Object adj = t.next(); - Graph.Edge edge = t.getEdge(); + Edge edge = t.getEdge(); if( edge.isDirected() ) { if( GraphUtils.equals( node, edge.getTail() ) ) { out.println( " " + node + " -- " + edge.getUserObject() + " -> " + adj ); @@ -67,7 +69,7 @@ } - public static void printEdge( PrintStream out, Graph.Edge edge ) + public static void printEdge( PrintStream out, Edge edge ) { Object object = edge.getUserObject(); Object tail = edge.getTail(); @@ -88,13 +90,13 @@ out.println( "#edges = " + graph.edges( null ).size() ); out.println( "\nNodes:" ); - for( Iterator i = graph.nodes( null ).iterator(); i.hasNext(); ) { - printNode( out, graph, i.next() ); + for( Object node : graph.nodes( null ) ) { + printNode( out, graph, node ); } out.println( "\nEdges:" ); - for( Iterator i = graph.edges( null ).iterator(); i.hasNext(); ) { - printEdge( out, (Graph.Edge) i.next() ); + for( Object edge : graph.edges( null ) ) { + printEdge( out, (Edge) edge ); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |