Sharkysoft home

lava.array
Class BooleanArrayCaster

java.lang.Object
  |
  +--lava.array.ArrayCaster
        |
        +--lava.array.BooleanArrayCaster

public abstract class BooleanArrayCaster
extends ArrayCaster

Casts between boolean arrays and arrays of other types.

Details: BooleanArrayCaster functions convert arrays of primitive types into arrays of booleans, and vice versa. When converting from double, float, long, int, short, byte, or char to boolean, the output is true only if the input is non-zero. When going the other way, the output is 1 if the input is true, 0 otherwise. When casting Object arrays to boolean arrays, the output is true only if the input is non-null.

The signatures for functions in this class follow the same rules as described in ArrayCaster.

Since:
1999.03.27
Version:
1999.09.11
Author:
Sharky
See Also:
ArrayCaster

Constructor Summary
BooleanArrayCaster()
           
 
Method Summary
static boolean[] toBooleans(byte[] src, int from, boolean[] dest, int to, int amt)
           
static boolean[] toBooleans(char[] src, int from, boolean[] dest, int to, int amt)
           
static boolean[] toBooleans(double[] src, int from, boolean[] dest, int to, int amt)
           
static boolean[] toBooleans(float[] src, int from, boolean[] dest, int to, int amt)
           
static boolean[] toBooleans(int[] src, int from, boolean[] dest, int to, int amt)
           
static boolean[] toBooleans(long[] src, int from, boolean[] dest, int to, int amt)
           
static boolean[] toBooleans(java.lang.Object[] src, int from, boolean[] dest, int to, int amt)
           
static boolean[] toBooleans(short[] src, int from, boolean[] dest, int to, int amt)
           
static byte[] toBytes(boolean[] src, int from, byte[] dest, int to, int amt)
           
static char[] toChars(boolean[] src, int from, char[] dest, int to, int amt)
           
static double[] toDoubles(boolean[] src, int from, double[] dest, int to, int amt)
           
static float[] toFloats(boolean[] src, int from, float[] dest, int to, int amt)
           
static int[] toInts(boolean[] src, int from, int[] dest, int to, int amt)
           
static long[] toLongs(boolean[] src, int from, long[] dest, int to, int amt)
           
static short[] toShorts(boolean[] src, int from, short[] dest, int to, int amt)
           
 
Methods inherited from class lava.array.ArrayCaster
getPrimitiveElementType, toBytes, toBytes, toBytes, toBytes, toBytes, toBytes, toChars, toChars, toChars, toChars, toChars, toChars, toDoubles, toDoubles, toDoubles, toDoubles, toDoubles, toDoubles, toFloats, toFloats, toFloats, toFloats, toFloats, toFloats, toInts, toInts, toInts, toInts, toInts, toInts, toLongs, toLongs, toLongs, toLongs, toLongs, toLongs, toShorts, toShorts, toShorts, toShorts, toShorts, toShorts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanArrayCaster

public BooleanArrayCaster()
Method Detail

toDoubles

public static final double[] toDoubles(boolean[] src,
                                       int from,
                                       double[] dest,
                                       int to,
                                       int amt)

toFloats

public static final float[] toFloats(boolean[] src,
                                     int from,
                                     float[] dest,
                                     int to,
                                     int amt)

toLongs

public static final long[] toLongs(boolean[] src,
                                   int from,
                                   long[] dest,
                                   int to,
                                   int amt)

toInts

public static final int[] toInts(boolean[] src,
                                 int from,
                                 int[] dest,
                                 int to,
                                 int amt)

toShorts

public static final short[] toShorts(boolean[] src,
                                     int from,
                                     short[] dest,
                                     int to,
                                     int amt)

toBytes

public static final byte[] toBytes(boolean[] src,
                                   int from,
                                   byte[] dest,
                                   int to,
                                   int amt)

toBooleans

public static final boolean[] toBooleans(double[] src,
                                         int from,
                                         boolean[] dest,
                                         int to,
                                         int amt)

toBooleans

public static final boolean[] toBooleans(float[] src,
                                         int from,
                                         boolean[] dest,
                                         int to,
                                         int amt)

toBooleans

public static final boolean[] toBooleans(long[] src,
                                         int from,
                                         boolean[] dest,
                                         int to,
                                         int amt)

toBooleans

public static final boolean[] toBooleans(int[] src,
                                         int from,
                                         boolean[] dest,
                                         int to,
                                         int amt)

toBooleans

public static final boolean[] toBooleans(short[] src,
                                         int from,
                                         boolean[] dest,
                                         int to,
                                         int amt)

toBooleans

public static final boolean[] toBooleans(byte[] src,
                                         int from,
                                         boolean[] dest,
                                         int to,
                                         int amt)

toBooleans

public static final boolean[] toBooleans(char[] src,
                                         int from,
                                         boolean[] dest,
                                         int to,
                                         int amt)

toChars

public static final char[] toChars(boolean[] src,
                                   int from,
                                   char[] dest,
                                   int to,
                                   int amt)

toBooleans

public static final boolean[] toBooleans(java.lang.Object[] src,
                                         int from,
                                         boolean[] dest,
                                         int to,
                                         int amt)

Sharkysoft home