X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Fimpl%2FTransformations.java;h=7fd3e10e7041efd6173dcc35832b94e67d0cbc46;hb=5b4ee8d862b98d127abb04c646017c184d005838;hp=20455e8a5e2b8633d4d783a5e1e26fed46e2c602;hpb=20807d81708bd33b3b5a4616fadcf3ae91bf9508;p=xmlrouter diff --git a/impl/src/main/java/org/wamblee/xmlrouter/impl/Transformations.java b/impl/src/main/java/org/wamblee/xmlrouter/impl/Transformations.java index 20455e8..7fd3e10 100644 --- a/impl/src/main/java/org/wamblee/xmlrouter/impl/Transformations.java +++ b/impl/src/main/java/org/wamblee/xmlrouter/impl/Transformations.java @@ -31,7 +31,7 @@ import org.wamblee.xmlrouter.config.Transformation; public class Transformations { private AtomicLong sequenceNumber; - private Map transformations; + private Map, Transformation> transformations; private List vertices; private TransformationPath[][] matrix; @@ -39,7 +39,7 @@ public class Transformations { public Transformations() { sequenceNumber = new AtomicLong(1); - transformations = new LinkedHashMap(); + transformations = new LinkedHashMap, Transformation>(); vertices = new ArrayList(); matrix = new TransformationPath[0][0]; } @@ -47,8 +47,7 @@ public class Transformations { public Id addTransformation(Transformation aTransformation) { long seqno = sequenceNumber.getAndIncrement(); Id id = new Id(seqno); - transformations.put(seqno, - new RobustTransformation(id, aTransformation)); + transformations.put(id, new RobustTransformation(id, aTransformation)); computeTransformationSequences(); return id; } @@ -145,12 +144,16 @@ public class Transformations { } public void removeTransformation(Id aId) { - transformations.remove(aId.getId()); + transformations.remove(aId); computeTransformationSequences(); } - public Collection getTransformations() { - return Collections.unmodifiableCollection(transformations.values()); + public Collection> getTransformations() { + return Collections.unmodifiableCollection(transformations.keySet()); + } + + public Transformation getTransformation(Id aId) { + return transformations.get(aId); } @Override