public class Transformations {
private AtomicLong sequenceNumber;
- private Map<Long, Transformation> transformations;
+ private Map<Id<Transformation>, Transformation> transformations;
private List<String> vertices;
private TransformationPath[][] matrix;
public Transformations() {
sequenceNumber = new AtomicLong(1);
- transformations = new LinkedHashMap<Long, Transformation>();
+ transformations = new LinkedHashMap<Id<Transformation>, Transformation>();
vertices = new ArrayList<String>();
matrix = new TransformationPath[0][0];
}
public Id<Transformation> addTransformation(Transformation aTransformation) {
long seqno = sequenceNumber.getAndIncrement();
Id<Transformation> id = new Id<Transformation>(seqno);
- transformations.put(seqno,
- new RobustTransformation(id, aTransformation));
+ transformations.put(id, new RobustTransformation(id, aTransformation));
computeTransformationSequences();
return id;
}
}
public void removeTransformation(Id<Transformation> aId) {
- transformations.remove(aId.getId());
+ transformations.remove(aId);
computeTransformationSequences();
}
- public Collection<Transformation> getTransformations() {
- return Collections.unmodifiableCollection(transformations.values());
+ public Collection<Id<Transformation>> getTransformations() {
+ return Collections.unmodifiableCollection(transformations.keySet());
+ }
+
+ public Transformation getTransformation(Id<Transformation> aId) {
+ return transformations.get(aId);
}
@Override