com.lamatek.util
Class ArrayUtil

java.lang.Object
  extended by com.lamatek.util.ArrayUtil

public class ArrayUtil
extends java.lang.Object

A utility class to create object arrays from a variety of collection based classes.


Constructor Summary
ArrayUtil()
           
 
Method Summary
 java.util.Enumeration createEnumeration(java.lang.Object[] objects)
          Returns an Enumeration from an array of Objects.
static java.lang.Object[] createObjectArray(java.util.Enumeration num)
          A static method that creates an array of Object from an Enumeration.
static java.lang.Object[] createObjectArray(java.util.Vector v)
          A static method that creates an array of Object from a Vector.
static java.lang.String[] createStringArray(java.util.Enumeration num)
          A static method that creates an array of String from an Enumeration.
static java.lang.String[] createStringArray(java.util.Vector v)
          A static method that creates an array of type String from a Vector.
static java.util.Vector createVector(java.lang.Object[] objects)
          Creates a Vector from an array of Objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayUtil

public ArrayUtil()
Method Detail

createObjectArray

public static java.lang.Object[] createObjectArray(java.util.Enumeration num)
A static method that creates an array of Object from an Enumeration.

Parameters:
num - - an instance of java.util.Enumeration
Returns:
Object[] an object array containing all the elements in the Enumeration

createObjectArray

public static java.lang.Object[] createObjectArray(java.util.Vector v)
A static method that creates an array of Object from a Vector.

Parameters:
v - - an instance of java.util.Vector
Returns:
Object[] an array of Objects containing all the elements from the Vector.

createStringArray

public static java.lang.String[] createStringArray(java.util.Enumeration num)
A static method that creates an array of String from an Enumeration. This method should only be called if it is known that all elements in 'num' are of type String. Otherwise you should use createObjectArray.

Parameters:
num - - an instance of Enumeration that is known to contain only elements of type java.lang.String.
Returns:
String[] an array of Strings contained in the Enumeration.

createStringArray

public static java.lang.String[] createStringArray(java.util.Vector v)
A static method that creates an array of type String from a Vector. This method should only be used if it is known that all the elements in the Vector are of type String. Otherwise use createObjectArray.

Parameters:
v - - an instance of Vector that is known to contain only elements of type String.
Returns:
String[] an array of Strings contained in the Vector.

createVector

public static java.util.Vector createVector(java.lang.Object[] objects)
Creates a Vector from an array of Objects.

Parameters:
objects - The array to convert
Returns:
A vector populated with the objects in 'objects'

createEnumeration

public java.util.Enumeration createEnumeration(java.lang.Object[] objects)
Returns an Enumeration from an array of Objects.

Parameters:
objects - the aray to convert.
Returns:
An Enumeration populated with the objects in 'objects'