/** * Returns a bitmap containing row numbers of all cells matching the given long * * @param value This is a 'key' from the index perspective, meaning it is a value from the standpoint of the column */ public Selection get(long value) { Selection selection = new BitmapBackedSelection(); IntArrayList list = index.get(value); if (list != null) { addAllToSelection(list, selection); } return selection; }
public Selection lessThan(long value) { Selection selection = new BitmapBackedSelection(); Long2ObjectSortedMap<IntArrayList> head = index.headMap(value); // we add 1 to get values equal to the arg for (IntArrayList keys : head.values()) { addAllToSelection(keys, selection); } return selection; }
public Selection greaterThan(long value) { Selection selection = new BitmapBackedSelection(); Long2ObjectSortedMap<IntArrayList> tail = index.tailMap(value + 1); for (IntArrayList keys : tail.values()) { addAllToSelection(keys, selection); } return selection; }
@Override protected Long2ObjectAVLTreeMap<V> create(Kryo kryo, Input input, Class<? extends Long2ObjectAVLTreeMap<V>> type, int size, LongComparator comparator) { return new Long2ObjectAVLTreeMap<V>(comparator); } }
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); /* * The storedComparator is now correctly set, but we must restore on-the-fly the * actualComparator. */ setActualComparator(); allocatePaths(); if (count != 0) { tree = readTree(s, count, null, null); Entry<V> e; e = tree; while (e.left() != null) e = e.left(); firstEntry = e; e = tree; while (e.right() != null) e = e.right(); lastEntry = e; } } }
/** * Returns the entry corresponding to the given key, if it is in the tree; * {@code null}, otherwise. * * @param k * the key to search for. * @return the corresponding entry, or {@code null} if no entry with the given * key exists. */ final Entry<V> findKey(final long k) { Entry<V> e = tree; int cmp; while (e != null && (cmp = compare(k, e.key)) != 0) e = cmp < 0 ? e.left() : e.right(); return e; } /**
@Override public boolean containsKey(final long k) { return findKey(k) != null; } @Override
@Override public V put(final long k, final V v) { Entry<V> e = add(k); final V oldValue = e.value; e.value = v; return oldValue; } /**
@Override public void clear() { Long2ObjectAVLTreeMap.this.clear(); } };
c.values = null; c.entries = null; c.allocatePaths(); if (count != 0) {
/** * Creates a new consistent hash function with given skip strategy. * * @param skipStrategy a skip strategy, or <code>null</code>. */ public ConsistentHashFunction( final SkipStrategy<T> skipStrategy ) { this( new Long2ObjectAVLTreeMap<Object>(), new Object2IntOpenHashMap<T>(), skipStrategy ); }
/** * Locates a key. * * @param k * a key. * @return the last entry on a search for the given key; this will be the given * key, if it present; otherwise, it will be either the smallest greater * key or the greatest smaller key. */ final Entry<V> locateKey(final long k) { Entry<V> e = tree, last = tree; int cmp = 0; while (e != null && (cmp = compare(k, e.key)) != 0) { last = e; e = cmp < 0 ? e.left() : e.right(); } return cmp == 0 ? e : last; } /**
@Override public V get(final long k) { final Entry<V> e = findKey(k); return e == null ? defRetValue : e.value; } @Override
public Selection atMost(long value) { Selection selection = new BitmapBackedSelection(); Long2ObjectSortedMap<IntArrayList> head = index.headMap(value + 1); // we add 1 to get values equal to the arg for (IntArrayList keys : head.values()) { addAllToSelection(keys, selection); } return selection; }
public Selection atLeast(long value) { Selection selection = new BitmapBackedSelection(); Long2ObjectSortedMap<IntArrayList> tail = index.tailMap(value); for (IntArrayList keys : tail.values()) { addAllToSelection(keys, selection); } return selection; }
for (Collection<ISubgraph> subgraphBin : alternateSubgraphOrdering) { for (ISubgraph subgraph : subgraphBin) { Long2ObjectMap<RemoteVertexInfo> remoteVertices = new Long2ObjectAVLTreeMap<>();
/** * Returns a bitmap containing row numbers of all cells matching the given long * * @param value This is a 'key' from the index perspective, meaning it is a value from the standpoint of the column */ public Selection get(long value) { Selection selection = new BitmapBackedSelection(); IntArrayList list = index.get(value); addAllToSelection(list, selection); return selection; }
int cmp, i = 0; while (true) { if ((cmp = compare(k, p.key)) == 0) { return p;
public Selection lessThan(long value) { Selection selection = new BitmapBackedSelection(); Long2ObjectSortedMap<IntArrayList> head = index.headMap(value); // we add 1 to get values equal to the arg for (IntArrayList keys : head.values()) { addAllToSelection(keys, selection); } return selection; }