From 6a710c3943f2350f4575f8cb1898129ef3c7dfdd Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Thu, 28 Nov 2024 10:42:31 -0500 Subject: rename assignment code replica package --- src/main/java/derms/replica/replica1/Hosts.java | 26 ------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/main/java/derms/replica/replica1/Hosts.java (limited to 'src/main/java/derms/replica/replica1/Hosts.java') diff --git a/src/main/java/derms/replica/replica1/Hosts.java b/src/main/java/derms/replica/replica1/Hosts.java deleted file mode 100644 index e27413d..0000000 --- a/src/main/java/derms/replica/replica1/Hosts.java +++ /dev/null @@ -1,26 +0,0 @@ -package derms.replica.replica1; - -import java.net.UnknownHostException; -import java.util.HashMap; -import java.util.Map; - -public class Hosts { - private static Map hosts = null; - - public static String get(City city) throws UnknownHostException { - if (hosts == null) - init(); - - String host = hosts.get(city); - if (host == null) - throw new UnknownHostException("unknown host: "+city); - return host; - } - - private static void init() { - hosts = new HashMap(); - hosts.put(new City("MTL"), "alpine1"); - hosts.put(new City("QUE"), "alpine2"); - hosts.put(new City("SHE"), "alpine3"); - } -} -- cgit v1.2.3