/** Returns the value to which the specified key is mapped, or {@code null} * if this map contains no mapping for the key. * <p>More formally, if this map contains a mapping from a key {@code k} to * a value {@code v} such that {@code key.equals(k)}, then this method * returns {@code v}; otherwise it returns {@code null}. (There can be at * most one such mapping.) * @throws NullPointerException if the specified key is null */ // Never returns a Prime nor a Tombstone. @Override public TypeV get( Object key ) { final int fullhash= hash (key); // throws NullPointerException if key is null final Object V = get_impl(this,_kvs,key,fullhash); assert !(V instanceof Prime); // Never return a Prime return (TypeV)V; }
private static final Object get_impl(final NonBlockingHashMap topmap, final Object[] kvs, final Object key) { final int fullhash = hash(key); // throws NullPointerException if key is null final int len = len(kvs); // Count of key/value pairs, reads kvs.length final CHM chm = chm(kvs); // The CHM, for a volatile read below; reads slot 0 of kvs
assert !(putval instanceof Prime); assert !(expVal instanceof Prime); final int fullhash = hash (key); // throws NullPointerException if key null final int len = len (kvs); // Count of key/value pairs, reads kvs.length final CHM chm = chm (kvs); // Reads kvs[0]
/** Returns the value to which the specified key is mapped, or {@code null} * if this map contains no mapping for the key. * <p>More formally, if this map contains a mapping from a key {@code k} to * a value {@code v} such that {@code key.equals(k)}, then this method * returns {@code v}; otherwise it returns {@code null}. (There can be at * most one such mapping.) * @throws NullPointerException if the specified key is null */ // Never returns a Prime nor a Tombstone. @Override public TypeV get( Object key ) { final int fullhash= hash (key); // throws NullPointerException if key is null final Object V = get_impl(this,_kvs,key,fullhash); assert !(V instanceof Prime); // Never return a Prime return (TypeV)V; }
assert !(putval instanceof Prime); assert !(expVal instanceof Prime); final int fullhash = hash (key); // throws NullPointerException if key null final int len = len (kvs); // Count of key/value pairs, reads kvs.length final CHM chm = chm (kvs); // Reads kvs[0]
/** Returns the value to which the specified key is mapped, or {@code null} * if this map contains no mapping for the key. * <p>More formally, if this map contains a mapping from a key {@code k} to * a value {@code v} such that {@code key.equals(k)}, then this method * returns {@code v}; otherwise it returns {@code null}. (There can be at * most one such mapping.) * @throws NullPointerException if the specified key is null */ // Never returns a Prime nor a Tombstone. @Override public TypeV get( Object key ) { final int fullhash= hash (key); // throws NullPointerException if key is null final Object V = get_impl(this,_kvs,key,fullhash); assert !(V instanceof Prime); // Never return a Prime return (TypeV)V; }
assert !(putval instanceof Prime); assert !(expVal instanceof Prime); final int fullhash = hash (key); // throws NullPointerException if key null final int len = len (kvs); // Count of key/value pairs, reads kvs.length final CHM chm = chm (kvs); // Reads kvs[0]
assert !(putval instanceof Prime); assert !(expVal instanceof Prime); final int fullhash = hash(key); // throws NullPointerException if key null final int len = len(kvs); // Count of key/value pairs, reads kvs.length final CHM chm = chm(kvs); // Reads kvs[0]