/** Fills a portion of the given array with the given value. * * <P>If possible (i.e., <code>from</code> is 0) this method uses a * backward loop. In this case, it is significantly faster than the * corresponding method in {@link java.util.Arrays}. * * @param array an array. * @param from the starting index of the portion to fill. * @param to the end index of the portion to fill. * @param value the new value for all elements of the specified portion of the array. */ public static void fill( final boolean[] array, final int from, int to, final boolean value ) { ensureFromTo( array, from, to ); if ( from == 0 ) while( to-- != 0 ) array[ to ] = value; else for( int i = from; i < to; i++ ) array[ i ] = value; } /** Returns true if the two arrays are elementwise equal.
/** * Fills a portion of the given array with the given value. * * @param array * an array. * @param from * the starting index of the portion to fill (inclusive). * @param to * the end index of the portion to fill (exclusive). * @param value * the new value for all elements of the specified portion of the * array. * @deprecated Please use the corresponding {@link java.util.Arrays} method. */ @Deprecated public static void fill(final boolean[] array, final int from, int to, final boolean value) { ensureFromTo(array, from, to); if (from == 0) while (to-- != 0) array[to] = value; else for (int i = from; i < to; i++) array[i] = value; } /**