/** * Ensure this container can hold at least the * given number of elements without resizing its buffers. * * @param expectedElements The total number of elements, inclusive. */ @Override public void ensureCapacity(int expectedElements) { if (expectedElements > resizeAt || keys == null) { final int[] prevKeys = this.keys; allocateBuffers(minBufferSize(expectedElements, loadFactor)); if (prevKeys != null && !isEmpty()) { rehash(prevKeys); } } }
@Override public GeolocationContextMapping build() { if(precisions.isEmpty()) { precisions.add(GeoHashUtils.PRECISION); } int[] precisionArray = precisions.toArray(); Arrays.sort(precisionArray); return new GeolocationContextMapping(name, precisionArray, neighbors, defaultLocations, fieldName); }
@Override public GeolocationContextMapping build() { if(precisions.isEmpty()) { precisions.add(GeoHashUtils.PRECISION); } int[] precisionArray = precisions.toArray(); Arrays.sort(precisionArray); return new GeolocationContextMapping(name, precisionArray, neighbors, defaultLocations, fieldName); }
@Override public GeolocationContextMapping build() { if(precisions.isEmpty()) { precisions.add(GeoHashUtils.PRECISION); } int[] precisionArray = precisions.toArray(); Arrays.sort(precisionArray); return new GeolocationContextMapping(name, precisionArray, neighbors, defaultLocations, fieldName); }
/** * Ensure this container can hold at least the * given number of elements without resizing its buffers. * * @param expectedElements The total number of elements, inclusive. */ @Override public void ensureCapacity(int expectedElements) { if (expectedElements > resizeAt || keys == null) { final int[] prevKeys = this.keys; allocateBuffers(minBufferSize(expectedElements, loadFactor)); if (prevKeys != null && !isEmpty()) { rehash(prevKeys); } } }