Sharkysoft home

Package lava.array

Array manipulation and conversion

See:
          Description

Class Summary
ArrayCaster Casts array elements from one type to another.
ArrayFiller Fills arrays.
ArrayShifter Shifts and rotates arrays.
BigEndianArray Splits/concatenates primitive integer types using "big endian" byte ordering.
BooleanArrayCaster Casts between boolean arrays and arrays of other types.
ByteArray32 232-entry virtual byte array.
LittleEndianArray Splits/concatenates primitive integer types using "little endian" byte ordering.
SignedArrayCaster Casts arrays of signed primitives.
UnsignedArrayCaster Casts arrays of unsigned primitives.
 

Package lava.array Description

Array manipulation and conversion

Details: This package contains functions for manipulating arrays, grouped into classes by similarity.

Most of the array conversion functions in this package take on the form

desttype[] funcname (srctype[] src, int from, desttype[] dest, int to, int amount)

where

funcname
is the name of the static method
srctype
is the primitive type of the source array (byte, short, int, float, etc.)
src
is the source array
from
is the starting index in the source array
desttype
is the primitive type of the destination array (byte, short, int, float, etc.)
dest
is the destination array
to
is the starting index in the destination array
amt
is the number of elements from the source array to process
the return value
is dest, returned for convenience

If src is null, no action is taken and null is returned. If dest is null, a new array of the correct destination type is created whose length is just long enough to accomodate the requested operation, and that new array is returned.

This package also contains ByteArray32, a class that efficiently simulates a sparsely populated 32-bit-addressable memory space. ByteArray32 has turned out to be useful in several computer science research applications and in other situations where large byte caches are required.


Sharkysoft home