Class VectorParser

java.lang.Object
  |
  +--VectorParser

public class VectorParser
extends java.lang.Object

VectorParser class.

The VectorParser class contains static convenience methods for converting Java Vectors to Java native arrays, which is syntactically awkward, but straight forward. It also provides methods for splitting Vectors of Points into component integer arrays.


Constructor Summary
VectorParser()
           
 
Method Summary
static double[] permuteDouble(java.util.Vector Iv, double[] d)
          Supply a permutation of a native array of doubles of a given Vector of indices
static double[] toDoubleArray(java.util.Vector Vect)
          Convert Vector to native array.
static float[] toFloatArray(java.util.Vector Vect)
          Convert Vector to native array.
static int[] toIntArray(java.util.Vector Vect)
          Convert Vector to native array.
static java.awt.Point[] toPointArray(java.util.Vector Vect)
          Convert Vector of Points to array of Points.
static int[] xSplitPoint(java.util.Vector Vect)
          Convert Vector of Points to native array of the X "coordinates."
static int[] ySplitPoint(java.util.Vector Vect)
          Convert Vector of Points to native array of the Y "coordinates."
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorParser

public VectorParser()
Method Detail

toDoubleArray

public static double[] toDoubleArray(java.util.Vector Vect)
Convert Vector to native array.

Parameters:
Vect - Vector containing potential doubles.
Returns:
native array of down-casted doubles.

toIntArray

public static int[] toIntArray(java.util.Vector Vect)
Convert Vector to native array.

Parameters:
Vect - Vector containing potential ints.
Returns:
native array of down-casted ints.

toPointArray

public static java.awt.Point[] toPointArray(java.util.Vector Vect)
Convert Vector of Points to array of Points.

Parameters:
Vect - Vector of Points.
Returns:
array of Points.

xSplitPoint

public static int[] xSplitPoint(java.util.Vector Vect)
Convert Vector of Points to native array of the X "coordinates."

Parameters:
Vect - Vector of Points.
Returns:
native array of X "coordinates" of the original Points.

ySplitPoint

public static int[] ySplitPoint(java.util.Vector Vect)
Convert Vector of Points to native array of the Y "coordinates."

Parameters:
Vect - Vector of Points.
Returns:
native array of Y "coordinates" of the original Points.

toFloatArray

public static float[] toFloatArray(java.util.Vector Vect)
Convert Vector to native array.

Parameters:
Vect - Vector containing potential floats.
Returns:
native array of down-casted floats.

permuteDouble

public static double[] permuteDouble(java.util.Vector Iv,
                                     double[] d)
Supply a permutation of a native array of doubles of a given Vector of indices

Parameters:
Iv - The Vector object containing the desired indices of the permutation as Integer objects.
d - The double array which is to be permuted.