summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-29 13:54:43 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-29 13:54:43 +0200
commit35e6857fb09b006da9f8cc3f59f239f078cc69a1 (patch)
tree9c049bc4a16a1202b1dc18ccd79ecfd8557f7dcc /instance-calculator/src/Instances.java
parentf1dfb1eb04a705521238dba64e09bb9ecdea794f (diff)
Still working on the implementation.
Diffstat (limited to 'instance-calculator/src/Instances.java')
-rw-r--r--instance-calculator/src/Instances.java30
1 files changed, 30 insertions, 0 deletions
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<Integer, String> instances;
+
+ static
+ {
+ instances = new HashMap<Integer, String>();
+ }
+
+ 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;
+ }
+}