From: <tan...@us...> - 2009-07-24 20:46:49
|
Revision: 901 http://cishell.svn.sourceforge.net/cishell/?rev=901&view=rev Author: tankchintan Date: 2009-07-24 20:46:36 +0000 (Fri, 24 Jul 2009) Log Message: ----------- Enforced the code style per new CheckStyle plugin & SUNS's specification. Modified Paths: -------------- trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphAlgorithm.java trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphAlgorithmFactory.java trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphComputation.java Modified: trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphAlgorithm.java =================================================================== --- trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphAlgorithm.java 2009-07-24 18:09:35 UTC (rev 900) +++ trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphAlgorithm.java 2009-07-24 20:46:36 UTC (rev 901) @@ -30,22 +30,15 @@ * @author Chintan Tank */ -public class ConverterGraphAlgorithm implements Algorithm{ +public class ConverterGraphAlgorithm implements Algorithm { - private static final int NODE_STRENGTH_INDEX = 1; - private static final int NODEID_INDEX = 0; - private static final int CONVERTER_SERVICE_PID_INDEX = 3; - private static final int CONVERTER_NAME_INDEX = 2; - private static final int EDGE_TARGETID_INDEX = 1; - private static final int EDGE_SOURCEID_INDEX = 0; - private LogService logger; private BundleContext bundleContext; private int nodeCount, edgeCount; /** - * Construct with the appropriate parameters + * Construct with the appropriate parameters. * @param ciShellContext * @param bundleContext * @throws AlgorithmExecutionException @@ -56,7 +49,7 @@ this.logger = (LogService) ciShellContext.getService(LogService.class.getName()); } - public Data[] execute() throws AlgorithmExecutionException{ + public Data[] execute() throws AlgorithmExecutionException { try { @@ -76,7 +69,7 @@ * */ File outputNWBFile = createOutputGraphFile(converterGraphComputation); - return prepareOutputMetadata(new BasicData(outputNWBFile,"file:text/nwb")); + return prepareOutputMetadata(new BasicData(outputNWBFile, "file:text/nwb")); } catch (IOException e) { throw new AlgorithmExecutionException(e); @@ -134,8 +127,8 @@ ConverterGraphComputation converterGraphComputation, ConverterGraphOutputGenerator outputGenerator) { - for(Iterator edgeIterator = converterGraphComputation.edges.iterator(); - edgeIterator.hasNext(); ) { + for (Iterator edgeIterator = converterGraphComputation.edges.iterator(); + edgeIterator.hasNext();) { Edge edge = (Edge) edgeIterator.next(); int sourceNode = edge.source; @@ -143,7 +136,7 @@ final String converterName = edge.serviceShortPID; final String servicePID = edge.serviceCompletePID; - outputGenerator.addDirectedEdge(sourceNode, targetNode, new HashMap(){{ + outputGenerator.addDirectedEdge(sourceNode, targetNode, new HashMap() {{ put("converter_name", converterName); put("service_pid", servicePID); }}); @@ -158,16 +151,16 @@ ConverterGraphComputation converterGraphComputation, ConverterGraphOutputGenerator outputGenerator) { - for(Iterator nodeIterator = converterGraphComputation.nodes.entrySet().iterator(); - nodeIterator.hasNext(); ) { + for (Iterator nodeIterator = converterGraphComputation.nodes.entrySet().iterator(); + nodeIterator.hasNext();) { Map.Entry node = (Entry) nodeIterator.next(); - int nodeID = ((Node)node.getValue()).id; - final int strength = ((Node)node.getValue()).strength; + int nodeID = ((Node) node.getValue()).id; + final int strength = ((Node) node.getValue()).strength; String label = node.getKey().toString(); - outputGenerator.addNode(nodeID, label, new HashMap(){{ + outputGenerator.addNode(nodeID, label, new HashMap() {{ put("strength", strength); }}); } Modified: trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphAlgorithmFactory.java =================================================================== --- trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphAlgorithmFactory.java 2009-07-24 18:09:35 UTC (rev 900) +++ trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphAlgorithmFactory.java 2009-07-24 20:46:36 UTC (rev 901) @@ -14,7 +14,7 @@ * */ -public class ConverterGraphAlgorithmFactory implements AlgorithmFactory{ +public class ConverterGraphAlgorithmFactory implements AlgorithmFactory { private BundleContext bundleContext; Modified: trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphComputation.java =================================================================== --- trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphComputation.java 2009-07-24 18:09:35 UTC (rev 900) +++ trunk/core/org.cishell.algorithm.convertergraph/src/org/cishell/algorithm/convertergraph/ConverterGraphComputation.java 2009-07-24 20:46:36 UTC (rev 901) @@ -99,26 +99,29 @@ * */ private void processServiceReferences() { - for(int converterCount = 0; converterCount < allConverterServices.length; converterCount++) { + for (int converterCount = 0; + converterCount < allConverterServices.length; + converterCount++) { int sourceNodeID, targetNodeID; - ServiceReference currentConverterServiceReference = allConverterServices[converterCount]; + ServiceReference currentConverterServiceReference = + allConverterServices[converterCount]; - String sourceNodeKey = (String)currentConverterServiceReference.getProperty("in_data"); - String targetNodeKey = (String)currentConverterServiceReference.getProperty("out_data"); + String sourceNodeKey = + (String) currentConverterServiceReference.getProperty("in_data"); + String targetNodeKey = + (String) currentConverterServiceReference.getProperty("out_data"); - if(nodes.containsKey(sourceNodeKey)) { - sourceNodeID = updateNode(sourceNodeKey); - } - else { + if (nodes.containsKey(sourceNodeKey)) { + sourceNodeID = updateNode(sourceNodeKey); + } else { sourceNodeID = createNode(sourceNodeKey); } - if(nodes.containsKey(targetNodeKey)) { + if (nodes.containsKey(targetNodeKey)) { targetNodeID = updateNode(targetNodeKey); - } - else { + } else { targetNodeID = createNode(targetNodeKey); } @@ -152,7 +155,8 @@ */ private void createEdge(int sourceNodeID, int targetNodeID, ServiceReference currentConverterServiceReference) { - String serviceCompletePID = (String)currentConverterServiceReference.getProperty("service.pid"); + String serviceCompletePID = + (String) currentConverterServiceReference.getProperty("service.pid"); /* * Converter name is placed in the last block of service.pid. This is used This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |