Tabnine Logo
UpdatableQHash
Code IndexAdd Tabnine to your IDE (free)

How to use
UpdatableQHash
in
net.openhft.koloboke.collect.impl.hash

Best Java code snippets using net.openhft.koloboke.collect.impl.hash.UpdatableQHash (Showing top 20 results out of 315)

origin: net.openhft/koloboke-impl-jdk6-7

private void internalInit(int capacity) {
  
  maxSize = maxSize(capacity);
  allocateArrays(capacity);
}
origin: net.openhft/koloboke-impl-jdk6-7

@Override
public boolean shrink() {
  int newCapacity = targetCapacity(size);
  if (newCapacity < capacity()) {
    rehash(newCapacity);
    return true;
  } else {
    return false;
  }
}
origin: net.openhft/koloboke-impl-jdk6-7

@Override
public void clear() {
  super.clear();
  Object[] tab = table;
  for (int i = 0; i < tab.length; i += 2) {
    tab[i] = FREE;
    tab[i + 1] = null;
  }
}
origin: net.openhft/koloboke-impl-jdk6-7

private boolean tryRehashForExpansion(int newCapacity) {
  if (newCapacity > capacity()) {
    rehash(newCapacity);
    return true;
  } else {
    return false;
  }
}
origin: net.openhft/koloboke-impl-jdk8

final void postInsertHook() {
  if (++size > maxSize) {
    tryRehashForExpansion(grownCapacity());
  }
}
origin: net.openhft/koloboke-impl-jdk6-7

void move(ParallelKVDoubleQHash hash) {
  super.copy(hash);
  table = hash.table();
}
origin: net.openhft/koloboke-impl-jdk8

final void init(HashConfigWrapper configWrapper, int size, byte freeValue
    ) {
  this.freeValue = freeValue;
  // calls allocateArrays, fill keys with this.freeValue => assign it before
  super.init(configWrapper, size);
}
origin: net.openhft/koloboke-impl-jdk8

  private int grownCapacity() {
    return nearestGreaterCapacity(configWrapper.grow(capacity()), size, doubleSizedArrays());
  }
}
origin: net.openhft/koloboke-impl-jdk8

final void init(HashConfigWrapper configWrapper, int size) {
  
  this.configWrapper = configWrapper;
  this.size = 0;
  internalInit(targetCapacity(size));
}
origin: net.openhft/koloboke-impl-jdk6-7

private boolean isMaxCapacity(int capacity) {
  return QHashCapacities.isMaxCapacity(capacity, doubleSizedArrays());
}
origin: net.openhft/koloboke-impl-jdk8

/**
 * This method just increments modification count (see {@link #modCount()})
 * and calls {@link #internalInit(int)}. Should be called by subclasses
 * in {@link #rehash(int)} implementation.
 */
final void initForRehash(int newCapacity) {
  modCount++;
  internalInit(newCapacity);
}
origin: net.openhft/koloboke-impl-jdk8

private int maxSize(int capacity) {
  // No sense in trying to rehash after each insertion
  // if the capacity is already reached the limit.
  return !isMaxCapacity(capacity) ? configWrapper.maxSize(capacity) : capacity - 1;
}
origin: net.openhft/koloboke-impl-jdk8

final void copy(QHash hash) {
  configWrapper = hash.configWrapper();
  size = hash.size();
  int capacity = hash.capacity();
  maxSize = maxSize(capacity);
}
origin: net.openhft/koloboke-impl-jdk8

void move(SeparateKVObjQHash hash) {
  super.copy(hash);
  set = hash.keys();
}
origin: net.openhft/koloboke-impl-jdk8

final void init(HashConfigWrapper configWrapper, int size, short freeValue
    ) {
  this.freeValue = freeValue;
  // calls allocateArrays, fill keys with this.freeValue => assign it before
  super.init(configWrapper, size);
}
origin: net.openhft/koloboke-impl-jdk8

private boolean tryRehashForExpansion(int newCapacity) {
  if (newCapacity > capacity()) {
    rehash(newCapacity);
    return true;
  } else {
    return false;
  }
}
origin: net.openhft/koloboke-impl-jdk6-7

final void postInsertHook() {
  if (++size > maxSize) {
    tryRehashForExpansion(grownCapacity());
  }
}
origin: net.openhft/koloboke-impl-jdk6-7

  private int grownCapacity() {
    return nearestGreaterCapacity(configWrapper.grow(capacity()), size, doubleSizedArrays());
  }
}
origin: net.openhft/koloboke-impl-jdk6-7

final void init(HashConfigWrapper configWrapper, int size) {
  
  this.configWrapper = configWrapper;
  this.size = 0;
  internalInit(targetCapacity(size));
}
origin: net.openhft/koloboke-impl-jdk6-7

private int targetCapacity(int size) {
  return QHashCapacities.capacity(configWrapper, size, doubleSizedArrays());
}
net.openhft.koloboke.collect.impl.hashUpdatableQHash

Most used methods

  • allocateArrays
    Allocates arrays of capacity length to hold states, elements, keys or values in. Subclasses should o
  • capacity
  • clear
    Empties the hash.
  • copy
  • doubleSizedArrays
    LongLong, LongDouble, DoubleDouble and DoubleLong maps might use array of doubled size as table to l
  • grownCapacity
  • init
  • internalInit
  • isMaxCapacity
  • maxSize
  • rehash
    Moves elements to the new arrays of newCapacity length.This method should be implemented as follows:
  • targetCapacity
  • rehash,
  • targetCapacity,
  • tryRehashForExpansion

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • Menu (java.awt)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now