public boolean contains(long item) { checkBiggerEqualZero(item); long h = hash(item); return getSection(h).contains(item, (int) h); }
@Override public void clear() { for (LinkedListImpl<T> list : levels) { list.clear(); } exclusiveSetSize(0); }
public ConcurrentLongHashSet keysLongHashSet() { ConcurrentLongHashSet concurrentLongHashSet = new ConcurrentLongHashSet(size()); forEach((key, value) -> concurrentLongHashSet.add(key)); return concurrentLongHashSet; }
public boolean add(long item) { checkBiggerEqualZero(item); long h = hash(item); return getSection(h).add(item, (int) h); }
@Override public void addTail(final T t, final int priority) { checkHighest(priority); levels[priority].addTail(t); exclusiveIncrementSize(1); }
@Override public void addHead(final T t, final int priority) { checkHighest(priority); levels[priority].addHead(t); exclusiveIncrementSize(1); }
public V get(long key) { long h = hash(key); return getSection(h).get(key, (int) h); }
public void putSimpleStringProperty(final SimpleString key, final SimpleString value) { checkCreateProperties(); doPutValue(key, value == null ? NullValue.INSTANCE : new StringValue(value)); }
public void putIntProperty(final SimpleString key, final int value) { checkCreateProperties(); doPutValue(key, new IntValue(value)); }
public void putDoubleProperty(final SimpleString key, final double value) { checkCreateProperties(); doPutValue(key, new DoubleValue(value)); }
public void putCharProperty(final SimpleString key, final char value) { checkCreateProperties(); doPutValue(key, new CharValue(value)); }
public void putBytesProperty(final SimpleString key, final byte[] value) { checkCreateProperties(); doPutValue(key, value == null ? NullValue.INSTANCE : new BytesValue(value)); }
public void putShortProperty(final SimpleString key, final short value) { checkCreateProperties(); doPutValue(key, new ShortValue(value)); }
public void putLongProperty(final SimpleString key, final long value) { checkCreateProperties(); doPutValue(key, new LongValue(value)); }
public void putFloatProperty(final SimpleString key, final float value) { checkCreateProperties(); doPutValue(key, new FloatValue(value)); }
@Override public E poll() { Node<E> ret = head.next; if (ret != null) { removeAfter(head); return ret.val(); } else { return null; } }
@Override public void addTail(E e) { if (size == 0) { addHead(e); } else { Node<E> node = Node.with(e); node.prev = tail; tail.next = node; tail = node; size++; } }
Section(int capacity) { this.capacity = alignToPowerOfTwo(capacity); this.keys = new long[this.capacity]; this.values = (V[]) new Object[this.capacity]; this.size = 0; this.usedBuckets = 0; this.resizeThreshold = (int) (this.capacity * MapFillFactor); }
public void clear() { for (Section s : sections) { s.clear(); } }
public void forEach(ConsumerLong processor) { for (Section s : sections) { s.forEach(processor); } }