Codota Logo
HashConfigWrapper.maxCapacity
Code IndexAdd Codota to your IDE (free)

How to use
maxCapacity
method
in
com.koloboke.collect.impl.hash.HashConfigWrapper

Best Java code snippets using com.koloboke.collect.impl.hash.HashConfigWrapper.maxCapacity (Showing top 6 results out of 315)

  • Common ways to obtain HashConfigWrapper
private void myMethod () {
HashConfigWrapper h =
  • Codota IconHashConfig config;new HashConfigWrapper(config)
  • Smart code suggestions by Codota
}
origin: com.koloboke/koloboke-impl-common-jdk8

/**
 * Same as {@link #chooseBetter(HashConfigWrapper, int, int, int, int, int)}.
 *
 * @see #chooseBetter(HashConfigWrapper, int, int, int, int, int)
 */
static long chooseBetter(HashConfigWrapper conf, long size,
    long desiredCapacity, long lesserCapacity, long greaterCapacity, long onFail) {
  assert 0L <= size;
  assert size < lesserCapacity && lesserCapacity < desiredCapacity;
  assert desiredCapacity < greaterCapacity;
  if (greaterCapacity - desiredCapacity <= desiredCapacity - lesserCapacity &&
      greaterCapacity <= conf.maxCapacity(size)) {
    return greaterCapacity;
  }
  return lesserCapacity >= conf.minCapacity(size) ? lesserCapacity : onFail;
}
origin: com.koloboke/koloboke-impl-common-jdk6-7

/**
 * Same as {@link #chooseBetter(HashConfigWrapper, int, int, int, int, int)}.
 *
 * @see #chooseBetter(HashConfigWrapper, int, int, int, int, int)
 */
static long chooseBetter(HashConfigWrapper conf, long size,
    long desiredCapacity, long lesserCapacity, long greaterCapacity, long onFail) {
  assert 0L <= size;
  assert size < lesserCapacity && lesserCapacity < desiredCapacity;
  assert desiredCapacity < greaterCapacity;
  if (greaterCapacity - desiredCapacity <= desiredCapacity - lesserCapacity &&
      greaterCapacity <= conf.maxCapacity(size)) {
    return greaterCapacity;
  }
  return lesserCapacity >= conf.minCapacity(size) ? lesserCapacity : onFail;
}
origin: com.koloboke/koloboke-impl-common-jdk8

assert desiredCapacity < greaterCapacity;
if (greaterCapacity - desiredCapacity <= desiredCapacity - lesserCapacity &&
    greaterCapacity <= conf.maxCapacity(size)) {
  return greaterCapacity;
origin: com.koloboke/koloboke-impl-common-jdk6-7

assert desiredCapacity < greaterCapacity;
if (greaterCapacity - desiredCapacity <= desiredCapacity - lesserCapacity &&
    greaterCapacity <= conf.maxCapacity(size)) {
  return greaterCapacity;
origin: com.koloboke/koloboke-impl-common-jdk8

static boolean configIsSuitableForImmutableHash(HashConfigWrapper conf, int size) {
  assert size >= 0;
  int desiredCapacity = conf.targetCapacity(size);
  if (desiredCapacity <= MIN_CAPACITY)
    return MIN_CAPACITY <= conf.maxCapacity(size);
  if (desiredCapacity < MAX_INT_CAPACITY) {
    if (isPowerOf2(desiredCapacity))
      return true;
    int lesserCapacity = highestOneBit(desiredCapacity);
    int greaterCapacity = lesserCapacity << 1;
    int c = chooseBetter(conf, size, desiredCapacity, lesserCapacity, greaterCapacity, -1);
    return c > 0;
  }
  return false;
}
origin: com.koloboke/koloboke-impl-common-jdk6-7

static boolean configIsSuitableForImmutableHash(HashConfigWrapper conf, int size) {
  assert size >= 0;
  int desiredCapacity = conf.targetCapacity(size);
  if (desiredCapacity <= MIN_CAPACITY)
    return MIN_CAPACITY <= conf.maxCapacity(size);
  if (desiredCapacity < MAX_INT_CAPACITY) {
    if (isPowerOf2(desiredCapacity))
      return true;
    int lesserCapacity = highestOneBit(desiredCapacity);
    int greaterCapacity = lesserCapacity << 1;
    int c = chooseBetter(conf, size, desiredCapacity, lesserCapacity, greaterCapacity, -1);
    return c > 0;
  }
  return false;
}
com.koloboke.collect.impl.hashHashConfigWrappermaxCapacity

Javadoc

Computes hash table capacity for the given size and min load of this config.

Popular methods of HashConfigWrapper

  • config
  • <init>
  • maxSize
  • grow
    Computes grown hash table capacity for the given capacity and growth factor of this config.
  • minCapacity
    Computes hash table capacity for the given size and max load of this config.
  • targetCapacity
    Computes hash table capacity for the given size and target load of this config.

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • notifyDataSetChanged (ArrayAdapter)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JTable (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now