Package com.carrotsearch.hppc

Examples of com.carrotsearch.hppc.LongLongOpenHashMap


public class LongLongHppcOpenHashMap extends AbstractWritableLongLongMap {
  protected final LongLongOpenHashMap myMap;

  public LongLongHppcOpenHashMap() {
    myMap = new LongLongOpenHashMap();
  }
View Full Code Here


  public LongLongHppcOpenHashMap() {
    myMap = new LongLongOpenHashMap();
  }

  public LongLongHppcOpenHashMap(int initialCapacity) {
    myMap = new LongLongOpenHashMap(initialCapacity);
  }
View Full Code Here

  public LongLongHppcOpenHashMap(int initialCapacity) {
    myMap = new LongLongOpenHashMap(initialCapacity);
  }

  public LongLongHppcOpenHashMap(int initialCapacity, float loadFactor) {
    myMap = new LongLongOpenHashMap(initialCapacity, loadFactor);
  }
View Full Code Here

public class LongLongHppcOpenHashMap extends AbstractWritableLongLongMap {
  protected final LongLongOpenHashMap myMap;

  public LongLongHppcOpenHashMap() {
    myMap = new LongLongOpenHashMap();
  }
View Full Code Here

  public LongLongHppcOpenHashMap() {
    myMap = new LongLongOpenHashMap();
  }

  public LongLongHppcOpenHashMap(int initicalCapacity) {
    myMap = new LongLongOpenHashMap(initicalCapacity);
  }
View Full Code Here

  public LongLongHppcOpenHashMap(int initicalCapacity) {
    myMap = new LongLongOpenHashMap(initicalCapacity);
  }

  public LongLongHppcOpenHashMap(int initialCapacity, float loadFactor) {
    myMap = new LongLongOpenHashMap(initialCapacity, loadFactor);
  }
View Full Code Here

    public void testDuell() {
        final Long[] values = new Long[randomIntBetween(1, 100000)];
        for (int i = 0; i < values.length; ++i) {
            values[i] = randomLong();
        }
        final LongLongMap valueToId = new LongLongOpenHashMap();
        final long[] idToValue = new long[values.length];
        final int iters = randomInt(1000000);
        for (int i = 0; i < iters; ++i) {
            final Long value = randomFrom(values);
            if (valueToId.containsKey(value)) {
                assertEquals(-1 - valueToId.get(value), hash.add(value));
            } else {
                assertEquals(valueToId.size(), hash.add(value));
                idToValue[valueToId.size()] = value;
                valueToId.put(value, valueToId.size());
            }
        }

        assertEquals(valueToId.size(), hash.size());
        for (Iterator<LongLongCursor> iterator = valueToId.iterator(); iterator.hasNext(); ) {
            final LongLongCursor next = iterator.next();
            assertEquals(next.value, hash.find(next.key));
        }

        for (long i = 0; i < hash.capacity(); ++i) {
View Full Code Here

TOP

Related Classes of com.carrotsearch.hppc.LongLongOpenHashMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.