Tabnine Logo
Arrays.checkStartAndEnd
Code IndexAdd Tabnine to your IDE (free)

How to use
checkStartAndEnd
method
in
java.util.Arrays

Best Java code snippets using java.util.Arrays.checkStartAndEnd (Showing top 20 results out of 315)

origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code byte} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code byte} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(byte[] array, int start, int end, byte value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code long} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code long} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(long[] array, int start, int end, long value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code short} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code short} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(short[] array, int start, int end, short value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code float} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code float} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(float[] array, int start, int end, float value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code Object} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code Object} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(Object[] array, int start, int end, Object value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code int} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code int} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(int[] array, int start, int end, int value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code double} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code double} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(double[] array, int start, int end, double value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code char} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code char} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(char[] array, int start, int end, char value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Fills the specified range in the array with the specified element.
 *
 * @param array
 *            the {@code boolean} array to fill.
 * @param start
 *            the first index to fill.
 * @param end
 *            the last + 1 index to fill.
 * @param value
 *            the {@code boolean} element.
 * @throws IllegalArgumentException
 *                if {@code start > end}.
 * @throws ArrayIndexOutOfBoundsException
 *                if {@code start < 0} or {@code end > array.length}.
 */
public static void fill(boolean[] array, int start, int end, boolean value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: robovm/robovm

/**
 * Sorts the specified range of the array into ascending order. The range
 * to be sorted extends from the index {@code fromIndex}, inclusive, to
 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
 * the range to be sorted is empty (and the call is a no-op).
 *
 * @param a the array to be sorted
 * @param fromIndex the index of the first element, inclusive, to be sorted
 * @param toIndex the index of the last element, exclusive, to be sorted
 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
 * @throws ArrayIndexOutOfBoundsException
 *     if {@code fromIndex < 0} or {@code toIndex > a.length}
 */
public static void sort(byte[] a, int fromIndex, int toIndex) {
  Arrays.checkStartAndEnd(a.length, fromIndex, toIndex);
  doSort(a, fromIndex, toIndex - 1);
}
origin: robovm/robovm

/**
 * Sorts the specified range of the array into ascending order. The range
 * to be sorted extends from the index {@code fromIndex}, inclusive, to
 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
 * the range to be sorted is empty (and the call is a no-op).
 *
 * @param a the array to be sorted
 * @param fromIndex the index of the first element, inclusive, to be sorted
 * @param toIndex the index of the last element, exclusive, to be sorted
 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
 * @throws ArrayIndexOutOfBoundsException
 *     if {@code fromIndex < 0} or {@code toIndex > a.length}
 */
public static void sort(int[] a, int fromIndex, int toIndex) {
  Arrays.checkStartAndEnd(a.length, fromIndex, toIndex);
  doSort(a, fromIndex, toIndex - 1);
}
origin: robovm/robovm

/**
 * Sorts the specified range of the array into ascending order. The range
 * to be sorted extends from the index {@code fromIndex}, inclusive, to
 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
 * the range to be sorted is empty (and the call is a no-op).
 *
 * @param a the array to be sorted
 * @param fromIndex the index of the first element, inclusive, to be sorted
 * @param toIndex the index of the last element, exclusive, to be sorted
 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
 * @throws ArrayIndexOutOfBoundsException
 *     if {@code fromIndex < 0} or {@code toIndex > a.length}
 */
public static void sort(long[] a, int fromIndex, int toIndex) {
  Arrays.checkStartAndEnd(a.length, fromIndex, toIndex);
  doSort(a, fromIndex, toIndex - 1);
}
origin: robovm/robovm

/**
 * Sorts the specified range of the array into ascending order. The range
 * to be sorted extends from the index {@code fromIndex}, inclusive, to
 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
 * the range to be sorted is empty (and the call is a no-op).
 *
 * @param a the array to be sorted
 * @param fromIndex the index of the first element, inclusive, to be sorted
 * @param toIndex the index of the last element, exclusive, to be sorted
 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
 * @throws ArrayIndexOutOfBoundsException
 *     if {@code fromIndex < 0} or {@code toIndex > a.length}
 */
public static void sort(short[] a, int fromIndex, int toIndex) {
  Arrays.checkStartAndEnd(a.length, fromIndex, toIndex);
  doSort(a, fromIndex, toIndex - 1);
}
origin: robovm/robovm

/**
 * Sorts the specified range of the array into ascending order. The range
 * to be sorted extends from the index {@code fromIndex}, inclusive, to
 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
 * the range to be sorted is empty (and the call is a no-op).
 *
 * @param a the array to be sorted
 * @param fromIndex the index of the first element, inclusive, to be sorted
 * @param toIndex the index of the last element, exclusive, to be sorted
 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
 * @throws ArrayIndexOutOfBoundsException
 *     if {@code fromIndex < 0} or {@code toIndex > a.length}
 */
public static void sort(char[] a, int fromIndex, int toIndex) {
  Arrays.checkStartAndEnd(a.length, fromIndex, toIndex);
  doSort(a, fromIndex, toIndex - 1);
}
origin: robovm/robovm

/**
 * Sorts the specified range of the array into ascending order. The range
 * to be sorted extends from the index {@code fromIndex}, inclusive, to
 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
 * the range to be sorted is empty  and the call is a no-op).
 *
 * <p>The {@code <} relation does not provide a total order on all float
 * values: {@code -0.0f == 0.0f} is {@code true} and a {@code Float.NaN}
 * value compares neither less than, greater than, nor equal to any value,
 * even itself. This method uses the total order imposed by the method
 * {@link Float#compareTo}: {@code -0.0f} is treated as less than value
 * {@code 0.0f} and {@code Float.NaN} is considered greater than any
 * other value and all {@code Float.NaN} values are considered equal.
 *
 * @param a the array to be sorted
 * @param fromIndex the index of the first element, inclusive, to be sorted
 * @param toIndex the index of the last element, exclusive, to be sorted
 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
 * @throws ArrayIndexOutOfBoundsException
 *     if {@code fromIndex < 0} or {@code toIndex > a.length}
 */
public static void sort(float[] a, int fromIndex, int toIndex) {
  Arrays.checkStartAndEnd(a.length, fromIndex, toIndex);
  sortNegZeroAndNaN(a, fromIndex, toIndex - 1);
}
origin: robovm/robovm

/**
 * Sorts the specified range of the array into ascending order. The range
 * to be sorted extends from the index {@code fromIndex}, inclusive, to
 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
 * the range to be sorted is empty (and the call is a no-op).
 *
 * <p>The {@code <} relation does not provide a total order on all double
 * values: {@code -0.0d == 0.0d} is {@code true} and a {@code Double.NaN}
 * value compares neither less than, greater than, nor equal to any value,
 * even itself. This method uses the total order imposed by the method
 * {@link Double#compareTo}: {@code -0.0d} is treated as less than value
 * {@code 0.0d} and {@code Double.NaN} is considered greater than any
 * other value and all {@code Double.NaN} values are considered equal.
 *
 * @param a the array to be sorted
 * @param fromIndex the index of the first element, inclusive, to be sorted
 * @param toIndex the index of the last element, exclusive, to be sorted
 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
 * @throws ArrayIndexOutOfBoundsException
 *     if {@code fromIndex < 0} or {@code toIndex > a.length}
 */
public static void sort(double[] a, int fromIndex, int toIndex) {
  Arrays.checkStartAndEnd(a.length, fromIndex, toIndex);
  sortNegZeroAndNaN(a, fromIndex, toIndex - 1);
}
origin: robovm/robovm

Arrays.checkStartAndEnd(a.length, lo, hi);
int nRemaining  = hi - lo;
if (nRemaining < 2)
origin: robovm/robovm

static void sort(Object[] a, int lo, int hi) {
  Arrays.checkStartAndEnd(a.length, lo, hi);
  int nRemaining  = hi - lo;
  if (nRemaining < 2)
origin: com.jtransc/jtransc-rt

@HaxeMethodBody(value = "p0.fill(p1, p2, p3);")
@JTranscMethodBody(target = "cpp", value = "GET_OBJECT(JA_C, p0)->fill(p1, p2, p3);")
public static void fill(char[] array, int start, int end, char value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
origin: com.jtransc/jtransc-rt

@HaxeMethodBody(value = "p0.fill(p1, p2, p3);")
@JTranscMethodBody(target = "cpp", value = "GET_OBJECT(JA_D, p0)->fill(p1, p2, p3);")
public static void fill(double[] array, int start, int end, double value) {
  Arrays.checkStartAndEnd(array.length, start, end);
  for (int i = start; i < end; i++) {
    array[i] = value;
  }
}
java.utilArrayscheckStartAndEnd

Javadoc

Checks that the range described by start and end doesn't exceed len.

Popular methods of Arrays

  • asList
  • toString
    Returns a string representation of the contents of the specified array. The string representation co
  • equals
    Returns true if the two specified arrays of booleans areequal to one another. Two arrays are conside
  • sort
    Sorts the specified range of the array into ascending order. The range to be sorted extends from the
  • copyOf
    Copies the specified array, truncating or padding with false (if necessary) so the copy has the spec
  • fill
    Assigns the specified boolean value to each element of the specified array of booleans.
  • stream
  • hashCode
    Returns a hash code based on the contents of the specified array. For any two boolean arrays a and
  • copyOfRange
    Copies the specified range of the specified array into a new array. The initial index of the range (
  • binarySearch
    Searches the specified array of shorts for the specified value using the binary search algorithm. Th
  • deepEquals
    Returns true if the two specified arrays are deeply equal to one another. Unlike the #equals(Object[
  • deepToString
  • deepEquals,
  • deepToString,
  • deepHashCode,
  • setAll,
  • parallelSort,
  • parallelSetAll,
  • spliterator,
  • checkBinarySearchBounds,
  • checkOffsetAndCount

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • BoxLayout (javax.swing)
  • From CI to AI: The AI layer in your organization
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