X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Fimpl%2FTransformationPaths.java;h=e6956d30b4f1faa7937e080ea2481b6a655d0a24;hb=e52385618670b54a5c6a4f2fbfab381bef43a905;hp=7a86c87d8f41e135bb9f659da4d1155222e2676b;hpb=b3f837bff31337a9a7cb6abeb22c5a981be39b51;p=xmlrouter diff --git a/impl/src/main/java/org/wamblee/xmlrouter/impl/TransformationPaths.java b/impl/src/main/java/org/wamblee/xmlrouter/impl/TransformationPaths.java index 7a86c87..e6956d3 100644 --- a/impl/src/main/java/org/wamblee/xmlrouter/impl/TransformationPaths.java +++ b/impl/src/main/java/org/wamblee/xmlrouter/impl/TransformationPaths.java @@ -18,12 +18,9 @@ package org.wamblee.xmlrouter.impl; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import java.util.Set; -import org.wamblee.xmlrouter.common.Id; import org.wamblee.xmlrouter.config.Transformation; /** @@ -35,24 +32,17 @@ import org.wamblee.xmlrouter.config.Transformation; */ public class TransformationPaths { - private Map, Transformation> transformations; + private Collection transformations; private List vertices; private TransformationPath[][] matrix; - private Map> sequences; - /** * Construct the transformations. */ - public TransformationPaths() { - transformations = new LinkedHashMap, Transformation>(); + public TransformationPaths(Collection aTransformations) { + transformations = aTransformations; vertices = new ArrayList(); matrix = new TransformationPath[0][0]; - } - - public void replaceTransformations( - Map, Transformation> aTransformations) { - transformations = aTransformations; computeTransformationSequences(); } @@ -112,7 +102,7 @@ public class TransformationPaths { // Obtain possible starting points. Set v = new HashSet(); - for (Transformation transformation : transformations.values()) { + for (Transformation transformation : transformations) { v.add(transformation.getFromType()); v.add(transformation.getToType()); } @@ -126,7 +116,7 @@ public class TransformationPaths { for (int i = 0; i < nvertices; i++) { matrix[i][i] = new TransformationPath(); } - for (Transformation transformation : transformations.values()) { + for (Transformation transformation : transformations) { int from = vertices.indexOf(transformation.getFromType()); int to = vertices.indexOf(transformation.getToType()); TransformationPath path = new TransformationPath(transformation);