Class ArrayWrapper

java.lang.Object
  extended by RJavaArrayIterator
      extended by ArrayWrapper

public class ArrayWrapper
extends RJavaArrayIterator

Utility class to deal with arrays


Field Summary
 
Fields inherited from class RJavaArrayIterator
array, dimensions, dimprod, increment, index, nd, position, start
 
Constructor Summary
ArrayWrapper(boolean x)
           
ArrayWrapper(byte x)
           
ArrayWrapper(char x)
           
ArrayWrapper(double x)
           
ArrayWrapper(float x)
           
ArrayWrapper(int x)
           
ArrayWrapper(long x)
           
ArrayWrapper(java.lang.Object array)
          Constructor
ArrayWrapper(short x)
           
 
Method Summary
 boolean[] flat_boolean()
          Flattens the array into a single dimensionned boolean array
 byte[] flat_byte()
          Flattens the array into a single dimensionned byte array
 char[] flat_char()
          Flattens the array into a single dimensionned double array
 double[] flat_double()
          Flattens the array into a single dimensionned double array
 float[] flat_float()
          Flattens the array into a single dimensionned float array
 int[] flat_int()
          Flattens the array into a single dimensionned int array
 long[] flat_long()
          Flattens the array into a single dimensionned long array
 java.lang.Object[] flat_Object()
           
 short[] flat_short()
          Flattens the array into a single dimensionned short array
 java.lang.String[] flat_String()
          Flattens the array into a single dimensionned String array
 java.lang.String getObjectTypeName()
           
 boolean isPrimitive()
           
 boolean isRectangular()
           
 
Methods inherited from class RJavaArrayIterator
getArray, getArrayClassName, getDimensions, hasNext, next
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayWrapper

public ArrayWrapper(java.lang.Object array)
             throws NotAnArrayException
Constructor

Parameters:
array - the array to check
Throws:
NotAnArrayException - if array is not an array

ArrayWrapper

public ArrayWrapper(int x)
             throws NotAnArrayException
Throws:
NotAnArrayException

ArrayWrapper

public ArrayWrapper(boolean x)
             throws NotAnArrayException
Throws:
NotAnArrayException

ArrayWrapper

public ArrayWrapper(byte x)
             throws NotAnArrayException
Throws:
NotAnArrayException

ArrayWrapper

public ArrayWrapper(long x)
             throws NotAnArrayException
Throws:
NotAnArrayException

ArrayWrapper

public ArrayWrapper(short x)
             throws NotAnArrayException
Throws:
NotAnArrayException

ArrayWrapper

public ArrayWrapper(double x)
             throws NotAnArrayException
Throws:
NotAnArrayException

ArrayWrapper

public ArrayWrapper(char x)
             throws NotAnArrayException
Throws:
NotAnArrayException

ArrayWrapper

public ArrayWrapper(float x)
             throws NotAnArrayException
Throws:
NotAnArrayException
Method Detail

isRectangular

public boolean isRectangular()
Returns:
true if the array is rectangular

getObjectTypeName

public java.lang.String getObjectTypeName()
Returns:
the type name of the objects stored in the wrapped array

isPrimitive

public boolean isPrimitive()
Returns:
true if the array contains java primitive types

flat_int

public int[] flat_int()
               throws PrimitiveArrayException,
                      FlatException
Flattens the array into a single dimensionned int array

Throws:
PrimitiveArrayException
FlatException

flat_boolean

public boolean[] flat_boolean()
                       throws PrimitiveArrayException,
                              FlatException
Flattens the array into a single dimensionned boolean array

Throws:
PrimitiveArrayException
FlatException

flat_byte

public byte[] flat_byte()
                 throws PrimitiveArrayException,
                        FlatException
Flattens the array into a single dimensionned byte array

Throws:
PrimitiveArrayException
FlatException

flat_long

public long[] flat_long()
                 throws PrimitiveArrayException,
                        FlatException
Flattens the array into a single dimensionned long array

Throws:
PrimitiveArrayException
FlatException

flat_short

public short[] flat_short()
                   throws PrimitiveArrayException,
                          FlatException
Flattens the array into a single dimensionned short array

Throws:
PrimitiveArrayException
FlatException

flat_double

public double[] flat_double()
                     throws PrimitiveArrayException,
                            FlatException
Flattens the array into a single dimensionned double array

Throws:
PrimitiveArrayException
FlatException

flat_char

public char[] flat_char()
                 throws PrimitiveArrayException,
                        FlatException
Flattens the array into a single dimensionned double array

Throws:
PrimitiveArrayException
FlatException

flat_float

public float[] flat_float()
                   throws PrimitiveArrayException,
                          FlatException
Flattens the array into a single dimensionned float array

Throws:
PrimitiveArrayException
FlatException

flat_Object

public java.lang.Object[] flat_Object()
                               throws FlatException,
                                      ObjectArrayException
Throws:
FlatException
ObjectArrayException

flat_String

public java.lang.String[] flat_String()
                               throws PrimitiveArrayException,
                                      FlatException
Flattens the array into a single dimensionned String array

Throws:
PrimitiveArrayException
FlatException