Class ArrayWrapper
- java.lang.Object
-
- RJavaArrayIterator
-
- 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
Constructors Constructor Description ArrayWrapper(boolean x)
ArrayWrapper(byte x)
ArrayWrapper(char x)
ArrayWrapper(double x)
ArrayWrapper(float x)
ArrayWrapper(int x)
ArrayWrapper(long x)
ArrayWrapper(short x)
ArrayWrapper(java.lang.Object array)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean[]
flat_boolean()
Flattens the array into a single dimensionned boolean arraybyte[]
flat_byte()
Flattens the array into a single dimensionned byte arraychar[]
flat_char()
Flattens the array into a single dimensionned double arraydouble[]
flat_double()
Flattens the array into a single dimensionned double arrayfloat[]
flat_float()
Flattens the array into a single dimensionned float arrayint[]
flat_int()
Flattens the array into a single dimensionned int arraylong[]
flat_long()
Flattens the array into a single dimensionned long arrayjava.lang.Object[]
flat_Object()
short[]
flat_short()
Flattens the array into a single dimensionned short arrayjava.lang.String[]
flat_String()
Flattens the array into a single dimensionned String arrayjava.lang.String
getObjectTypeName()
boolean
isPrimitive()
boolean
isRectangular()
-
Methods inherited from class RJavaArrayIterator
getArray, getArrayClassName, getDimensions, hasNext, next
-
-
-
-
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
-
-