Synchronized and moved Hash classes

This commit is contained in:
FrozenCow
2011-03-01 19:19:50 +01:00
committed by Tahg
parent 13fb0e07ce
commit 9832ce06f1
5 changed files with 15 additions and 15 deletions

View File

@@ -0,0 +1,36 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.bukkit.craftbukkit.util;
/**
*
* @author Nathan
*/
public abstract class LongHash {
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);
}