public boolean add(long item1, long item2) { checkBiggerEqualZero(item1); long h = hash(item1, item2); return getSection(h).add(item1, item2, (int) h); }
public boolean contains(long item1, long item2) { checkBiggerEqualZero(item1); long h = hash(item1, item2); return getSection(h).contains(item1, item2, (int) h); }
public V get(long key) { long h = hash(key); return getSection(h).get(key, (int) h); }
public V computeIfAbsent(long key, LongFunction<V> provider) { checkNotNull(provider); long h = hash(key); return getSection(h).put(key, null, (int) h, true, provider); }
public V computeIfAbsent(K key, Function<K, V> provider) { checkNotNull(key); checkNotNull(provider); long h = hash(key); return getSection(h).put(key, null, (int) h, true, provider); }
/** * Remove an existing entry if found * * @param item1 * @return true if removed or false if item was not present */ public boolean remove(long item1, long item2) { checkBiggerEqualZero(item1); long h = hash(item1, item2); return getSection(h).remove(item1, item2, (int) h); }
public V get(K key) { checkNotNull(key); long h = hash(key); return getSection(h).get(key, (int) h); }
@Override public boolean offer(T e) { // Queue is unbounded and it will never reject new items put(e); return true; }
public synchronized void forEach(LongPairConsumer processor) { int index = 0; for (int i = 0; i < this.size; i++) { processor.accept(data[index], data[index + 1]); index = index + 2; } }
public void clear() { for (Section s : sections) { s.clear(); } }
public void forEach(LongPairConsumer processor) { for (Section s : sections) { s.forEach(processor); } }
private final void cleanBucket(int bucket) { int nextInArray = signSafeMod(bucket + 1, capacity); if (values[nextInArray] == EmptyValue) { values[bucket] = (V) EmptyValue; --usedBuckets; } else { values[bucket] = (V) DeletedValue; } }
public void forEach(EntryProcessor<V> processor) { for (Section<V> s : sections) { s.forEach(processor); } }
public void clear() { for (Section<K, V> s : sections) { s.clear(); } }
public void forEach(BiConsumer<? super K, ? super V> processor) { for (Section<K, V> s : sections) { s.forEach(processor); } }
public void clear() { for (Section<V> s : sections) { s.clear(); } }
@Override public int drainTo(Collection<? super T> c) { return drainTo(c, Integer.MAX_VALUE); }
public V putIfAbsent(long key, V value) { checkNotNull(value); long h = hash(key); return getSection(h).put(key, value, (int) h, true, null); }
public V putIfAbsent(K key, V value) { checkNotNull(key); checkNotNull(value); long h = hash(key); return getSection(h).put(key, value, (int) h, true, null); }
@Override public boolean add(T e) { put(e); return true; }