From 35e6857fb09b006da9f8cc3f59f239f078cc69a1 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Tue, 29 Aug 2017 13:54:43 +0200 Subject: Still working on the implementation. --- instance-calculator/src/Instances.java | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 instance-calculator/src/Instances.java (limited to 'instance-calculator/src/Instances.java') diff --git a/instance-calculator/src/Instances.java b/instance-calculator/src/Instances.java new file mode 100644 index 0000000..5d6ec8b --- /dev/null +++ b/instance-calculator/src/Instances.java @@ -0,0 +1,30 @@ +import java.util.*; + +public class Instances +{ + private static final Map instances; + + static + { + instances = new HashMap(); + } + + public static String get_id_for (final int i) + { + final Integer j; + String result; + + j = new Integer(i); + + result = instances.get(j); + + if (result == null) + { + result = (Main.get_parameters().get_id_prefix() + i); + + instances.put(j, result); + } + + return result; + } +} -- cgit v1.2.3-70-g09d2