Sharkysoft home

lava.array
Class ArrayFiller

java.lang.Object
  |
  +--lava.array.ArrayFiller

public class ArrayFiller
extends java.lang.Object

Fills arrays.

Details: ArrayFiller is a collection of functions for filling arrays with values. In each of the fill methods, if the array passed in is null, no action is taken and no exception is thrown.

Author:
Sharky

Constructor Summary
ArrayFiller()
           
 
Method Summary
static void fill(byte[] array, byte b)
          Fills an array of bytes with the specified value.
static void fill(char[] array, char value)
          Fills an array of chars with the specified value.
static void fill(double[] array, double value)
          Fills an array of doubles with the specified value.
static void fill(float[] array, float value)
          Fills an array of floats with the specified value.
static void fill(int[] array, int value)
          Fills an array of ints with the specified value.
static void fill(long[] array, long value)
          Fills an array of longs with the specified value.
static void fill(java.lang.Object[] array, java.lang.Object obj)
          Fills an array with the specified Object.
static void fill(short[] array, short value)
          Fills an array of shorts with the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayFiller

public ArrayFiller()
Method Detail

fill

public static void fill(java.lang.Object[] array,
                        java.lang.Object obj)
Fills an array with the specified Object. If array is null, no action is taken and no exception is thrown. If array's type prohibits storing obj in its elements, an ArrayStoreException is thrown.
Parameters:
array - the array
obj - the object
Throws:
ArrayStoreException - if array cannot hold obj

fill

public static void fill(byte[] array,
                        byte b)
Fills an array of bytes with the specified value.
Parameters:
array - the array
value - the value

fill

public static void fill(short[] array,
                        short value)
Fills an array of shorts with the specified value.
Parameters:
array - the array
value - the value

fill

public static void fill(int[] array,
                        int value)
Fills an array of ints with the specified value.
Parameters:
array - the array
value - the value

fill

public static void fill(long[] array,
                        long value)
Fills an array of longs with the specified value.
Parameters:
array - the array
value - the value

fill

public static void fill(float[] array,
                        float value)
Fills an array of floats with the specified value.
Parameters:
array - the array
value - the value

fill

public static void fill(double[] array,
                        double value)
Fills an array of doubles with the specified value.
Parameters:
array - the array
value - the value

fill

public static void fill(char[] array,
                        char value)
Fills an array of chars with the specified value.
Parameters:
array - the array
value - the value

Sharkysoft home