diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-11-28 10:42:31 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-11-28 10:42:31 -0500 |
| commit | 6a710c3943f2350f4575f8cb1898129ef3c7dfdd (patch) | |
| tree | dc20bc0480e77a74f2176e5f0fed02ad2251a2cd /src/main/java/derms/replica/replica1/Servers.java | |
| parent | 0cae203edc71b0285d2971f9124f24cb543b8e39 (diff) | |
| download | soen423-6a710c3943f2350f4575f8cb1898129ef3c7dfdd.zip | |
rename assignment code replica package
Diffstat (limited to 'src/main/java/derms/replica/replica1/Servers.java')
| -rw-r--r-- | src/main/java/derms/replica/replica1/Servers.java | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/main/java/derms/replica/replica1/Servers.java b/src/main/java/derms/replica/replica1/Servers.java deleted file mode 100644 index ed1255a..0000000 --- a/src/main/java/derms/replica/replica1/Servers.java +++ /dev/null @@ -1,34 +0,0 @@ -package derms.replica.replica1; - -import java.net.InetAddress; -import java.util.Collection; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -public class Servers { - private Map<City, InetAddress> servers = new ConcurrentHashMap<City, InetAddress>(); - - /** Returns the address of the server located in the specified city, or null if there is no server in the city. */ - public InetAddress get(City city) { - return servers.get(city); - } - - /** - * Associates the specified server address with the specified city. - * If there was already a server associated with the city, the old value is replaced. - * @param city the city where the server is located - * @param addr the address of the server - * @return the previous server address, or null if there was no server associated with this city. - */ - public InetAddress put(City city, InetAddress addr) { - return servers.put(city, addr); - } - - public Collection<InetAddress> all() { - return servers.values(); - } - - public int size() { - return servers.size(); - } -} |