summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/LongHash.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/LongHash.java')
-rw-r--r--src/main/java/net/minecraft/server/LongHash.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/LongHash.java b/src/main/java/net/minecraft/server/LongHash.java
new file mode 100644
index 00000000..06da49ab
--- /dev/null
+++ b/src/main/java/net/minecraft/server/LongHash.java
@@ -0,0 +1,36 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package net.minecraft.server;
+
+/**
+ *
+ * @author Nathan
+ */
+public abstract class LongHash<V> {
+ static long toLong(int msw, int lsw) {
+ return ((long)msw << 32) + lsw - Integer.MIN_VALUE;
+ }
+
+ static int msw(long l) {
+ return (int) (l >> 32);
+ }
+
+ static int lsw(long l) {
+ return (int) (l & 0xFFFFFFFF) + Integer.MIN_VALUE;
+ }
+
+ public boolean containsKey(int msw, int lsw) {
+ return containsKey(toLong(msw, lsw));
+ }
+
+ public void remove(int msw, int lsw) {
+ remove(toLong(msw, lsw));
+ }
+
+ public abstract boolean containsKey(long key);
+
+ public abstract void remove(long key);
+}