JavaView® v2.12

jv.vecmath
Class PuData

java.lang.Object
  |
  +--jv.vecmath.PuData
All Implemented Interfaces:
java.io.Serializable

public class PuData
extends java.lang.Object
implements java.io.Serializable

Static memory methods on number arrays.

Version:
00.00.97, 1.00 revised (kp)
00.00.97, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
Serialized Form

Constructor Summary
PuData()
           
 
Method Summary
static double[] copy(double[] data, int size)
          Copy an array into a new array.
static float[] copy(float[] data, int size)
          Copy an array into a new array.
static int[] copy(int[] data, int size)
          Copy an array into a new array.
static boolean[] realloc(boolean[] data, int size)
          Create a new array with given size, if size is different than given array.
static boolean[] realloc(boolean[] data, int size, boolean initial)
          Create a new array with given size, if size is different than given array.
static java.lang.Object[] realloc(java.lang.Class cl, java.lang.Object[] data, int size)
          Create a new array with given size, if size is different than given array.
static double[] realloc(double[] data, int size)
          Create a new array with given size, if size is different than given array.
static double[] realloc(double[] data, int size, double initial)
          Create a new array with given size, if size is different than given array.
static float[] realloc(float[] data, int size)
          Create a new array with given size, if size is different than given array.
static float[] realloc(float[] data, int size, float initial)
          Create a new array with given size, if size is different than given array.
static int[] realloc(int[] data, int size)
          Create a new array with given size, if size is different than given array.
static int[] realloc(int[] data, int size, int initial)
          Create a new array with given size, if size is different than given array.
static java.lang.String[] realloc(java.lang.String[] data, int size)
          Create a new array with given size, if size is different than given array.
static java.lang.String[] realloc(java.lang.String[] data, int size, java.lang.String initial)
          Create a new array with given size, if size is different than given array.
static java.lang.String toString(double[] data)
          Create single line string of double array where components are separated by blanks.
static java.lang.String toString(float[] data)
          Create single line string of float array where components are separated by blanks.
static java.lang.String toString(int[] data)
          Create single line string of integer array where components are separated by blanks.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PuData

public PuData()
Method Detail

toString

public static java.lang.String toString(double[] data)
Create single line string of double array where components are separated by blanks.
Returns:
single-line string, or null of argument==null or zero length.

toString

public static java.lang.String toString(float[] data)
Create single line string of float array where components are separated by blanks.
Returns:
single-line string, or null of argument==null or zero length.

toString

public static java.lang.String toString(int[] data)
Create single line string of integer array where components are separated by blanks.
Returns:
single-line string, or null of argument==null or zero length.

copy

public static double[] copy(double[] data,
                            int size)
Copy an array into a new array.
Parameters:
data - source array
size - size of new array, must be less or equal data.length

copy

public static float[] copy(float[] data,
                           int size)
Copy an array into a new array.
Parameters:
data - source array
size - size of new array, must be less or equal data.length

copy

public static int[] copy(int[] data,
                         int size)
Copy an array into a new array.
Parameters:
data - source array
size - size of new array, must be less or equal data.length

realloc

public static java.lang.Object[] realloc(java.lang.Class cl,
                                         java.lang.Object[] data,
                                         int size)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized.

The effect is that of the equivalent array creation expression: new cl[size] and copying of existing data into this new array.

Parameters:
data - source array, may be null.
size - size of new array

realloc

public static double[] realloc(double[] data,
                               int size)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized.
Parameters:
data - source array, may be null.
size - size of new array

realloc

public static float[] realloc(float[] data,
                              int size)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized.
Parameters:
data - source array, may be null.
size - size of new array

realloc

public static int[] realloc(int[] data,
                            int size)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized.
Parameters:
data - source array, may be null.
size - size of new array

realloc

public static boolean[] realloc(boolean[] data,
                                int size)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized.
Parameters:
data - source array, may be null.
size - size of new array

realloc

public static java.lang.String[] realloc(java.lang.String[] data,
                                         int size)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized.
Parameters:
data - source array, may be null.
size - size of new array

realloc

public static double[] realloc(double[] data,
                               int size,
                               double initial)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized. If new array is larger than existing array then initialize its components with given parameter.
Parameters:
data - source array, may be null.
size - size of new array
initial - initial value of new components.

realloc

public static float[] realloc(float[] data,
                              int size,
                              float initial)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized. If new array is larger than existing array then initialize its components with given parameter.
Parameters:
data - source array, may be null.
size - size of new array
initial - initial value of new components.

realloc

public static int[] realloc(int[] data,
                            int size,
                            int initial)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized. If new array is larger than existing array then initialize its components with given parameter.
Parameters:
data - source array, may be null.
size - size of new array
initial - initial value of new components.

realloc

public static boolean[] realloc(boolean[] data,
                                int size,
                                boolean initial)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized. If new array is larger than existing array then initialize its components with given parameter.
Parameters:
data - source array, may be null.
size - size of new array
initial - initial value of new components.

realloc

public static java.lang.String[] realloc(java.lang.String[] data,
                                         int size,
                                         java.lang.String initial)
Create a new array with given size, if size is different than given array. Copy as much as possible data of the given array into the new array. If new array is larger than given array, the empty space is not initialized. If new array is larger than existing array then initialize its components with given parameter.
Parameters:
data - source array, may be null.
size - size of new array
initial - initial value of new components.

JavaView® v2.12

The software JavaView® is copyright protected. All Rights Reserved.