/** * Returns a prime number which is <code>>= desiredCapacity</code> and very close to <code>desiredCapacity</code> * (within 11% if <code>desiredCapacity >= 1000</code>). * * @param desiredCapacity the capacity desired by the user. * @return the capacity which should be used for a hashtable. */ protected int nextPrime(int desiredCapacity) { return PrimeFinder.nextPrime(desiredCapacity); }
@Test public void testEnsureCapacity() { OpenIntByteHashMap map = new OpenIntByteHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenShortHashSet map = new OpenShortHashSet(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenLongByteHashMap map = new OpenLongByteHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenObjectShortHashMap<String> map = new OpenObjectShortHashMap<String>(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenShortShortHashMap map = new OpenShortShortHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenDoubleIntHashMap map = new OpenDoubleIntHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenDoubleCharHashMap map = new OpenDoubleCharHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenLongIntHashMap map = new OpenLongIntHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenCharLongHashMap map = new OpenCharLongHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenFloatLongHashMap map = new OpenFloatLongHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenObjectIntHashMap<String> map = new OpenObjectIntHashMap<String>(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenByteShortHashMap map = new OpenByteShortHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenObjectCharHashMap<String> map = new OpenObjectCharHashMap<String>(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenIntDoubleHashMap map = new OpenIntDoubleHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenDoubleShortHashMap map = new OpenDoubleShortHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenFloatByteHashMap map = new OpenFloatByteHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenShortLongHashMap map = new OpenShortLongHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenCharShortHashMap map = new OpenCharShortHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }
@Test public void testEnsureCapacity() { OpenShortDoubleHashMap map = new OpenShortDoubleHashMap(); int prime = PrimeFinder.nextPrime(907); map.ensureCapacity(prime); int[] capacity = new int[1]; double[] minLoadFactor = new double[1]; double[] maxLoadFactor = new double[1]; map.getInternalFactors(capacity, minLoadFactor, maxLoadFactor); assertEquals(prime, capacity[0]); }