Tabnine Logo
BooleanArrays.ensureCapacity
Code IndexAdd Tabnine to your IDE (free)

How to use
ensureCapacity
method
in
it.unimi.dsi.fastutil.booleans.BooleanArrays

Best Java code snippets using it.unimi.dsi.fastutil.booleans.BooleanArrays.ensureCapacity (Showing top 4 results out of 315)

origin: it.unimi.dsi/fastutil

/**
 * Ensures that this array list can contain the given number of entries without
 * resizing.
 *
 * @param capacity
 *            the new minimum capacity for this array list.
 */
public void ensureCapacity(final int capacity) {
  if (capacity <= a.length || a == BooleanArrays.DEFAULT_EMPTY_ARRAY)
    return;
  a = BooleanArrays.ensureCapacity(a, capacity, size);
  assert size <= a.length;
}
/**
origin: it.unimi.dsi/fastutil

/**
 * Ensures that an array can contain the given number of entries.
 *
 * <p>
 * If you cannot foresee whether this array will need again to be enlarged, you
 * should probably use {@code grow()} instead.
 *
 * @param array
 *            an array.
 * @param length
 *            the new minimum length for this array.
 * @return {@code array}, if it contains {@code length} entries or more;
 *         otherwise, an array with {@code length} entries whose first
 *         {@code array.length} entries are the same as those of {@code array}.
 */
public static boolean[] ensureCapacity(final boolean[] array, final int length) {
  return ensureCapacity(array, length, array.length);
}
/**
origin: AliView/AliView

/** Sets the length of the given array.
  *
  * @param array an array.
  * @param length the new length for the array.
  * @return <code>array</code>, if it contains exactly <code>length</code>
  * entries; otherwise, if it contains <em>more</em> than
  * <code>length</code> entries, an array with <code>length</code> entries
  * whose entries are the same as the first <code>length</code> entries of
  * <code>array</code>; otherwise, an array with <code>length</code> entries
  * whose first <code>array.length</code> entries are the same as those of
  * <code>array</code>.
  * 
  */
public static boolean[] setLength( final boolean[] array, final int length ) {
if ( length == array.length ) return array;
if ( length < array.length ) return trim( array, length );
return ensureCapacity( array, length );
}
/** Returns a copy of a portion of an array.
origin: it.unimi.dsi/fastutil

/**
 * Sets the length of the given array.
 *
 * @param array
 *            an array.
 * @param length
 *            the new length for the array.
 * @return {@code array}, if it contains exactly {@code length} entries;
 *         otherwise, if it contains <em>more</em> than {@code length} entries,
 *         an array with {@code length} entries whose entries are the same as
 *         the first {@code length} entries of {@code array}; otherwise, an
 *         array with {@code length} entries whose first {@code array.length}
 *         entries are the same as those of {@code array}.
 *
 */
public static boolean[] setLength(final boolean[] array, final int length) {
  if (length == array.length)
    return array;
  if (length < array.length)
    return trim(array, length);
  return ensureCapacity(array, length);
}
/**
it.unimi.dsi.fastutil.booleansBooleanArraysensureCapacity

Javadoc

Ensures that an array can contain the given number of entries.

If you cannot foresee whether this array will need again to be enlarged, you should probably use grow() instead.

Popular methods of BooleanArrays

  • quickSort
    Sorts the specified range of elements of two arrays according to the natural lexicographical ascendi
  • ensureFromTo
    Ensures that a range given by its first (inclusive) and last (exclusive) elements fits an array. Thi
  • ensureOffsetLength
    Ensures that a range given by an offset and a length fits an array. This method may be used whenever
  • fill
    Fills the given array with the given value.
  • insertionSort
  • med3
  • mergeSort
    Sorts an array according to the order induced by the specified comparator using mergesort. This sort
  • selectionSort
  • swap
  • trim
    Trims the given array to the given length.
  • ensureSameLength
    Ensures that two arrays are of the same length.
  • equals
    Returns true if the two arrays are elementwise equal.
  • ensureSameLength,
  • equals,
  • forceCapacity,
  • grow,
  • insertionSortIndirect,
  • med3Indirect,
  • parallelQuickSort,
  • parallelQuickSortIndirect,
  • quickSortIndirect

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best plugins for Eclipse
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