summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/LongHash.java
blob: 06da49ab340778c3b18f2310e7075a2e01b4850a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
}