Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

cern::gp::util::ArrayUtil Class Reference

List of all members.

Static Public Member Functions

Object concatArrays (final Object[] one, final Object[] two, Class componentType)
Object concatArrays (final Object[] one, final Object[] two, final Object[] three, Class componentType)
Object concatArrays (final Object[][] origMatrix)
Object concatArrays (final Object[][] origMatrix, final int totalLength)
void printArray (final Object[] array, int indent)
String toString (final Object[] array, int indent, boolean oneLine, boolean numbered)
Object pruneNullElements (Object[] array)
Object pruneNullElements (Object[] array, boolean onlyAtEnd)
boolean allElementsSameType (Object[] array)
void sleep (long millis)

Detailed Description

Utility methods for manipulating and displaying Arrays
Author:
Vito Baggiolini
Version:
Revision
1.2
Date
2006/09/25 08:52:36


Member Function Documentation

boolean cern::gp::util::ArrayUtil::allElementsSameType Object[]  array  )  [inline, static]
 

An utility method that checks whether all the elements in the array are of the same type it returns false if the array contains a mix of classes and sub-classes of the Array component type.

Parameters:
array the array to be checked
Returns:
true if all array elements are of the same class

Object cern::gp::util::ArrayUtil::concatArrays final Object  origMatrix[][],
final int  totalLength
[inline, static]
 

An utility method that concatenates many arrays to one. The type of the returned array are derived from the type of the origMatrix parameter, the length is specified.

Parameters:
origMatrix an array of arrays (a Matrix), can contain null elements
totalLength the length of the resulting array, must be large enough
Returns:
an array with the concatenated values

Object cern::gp::util::ArrayUtil::concatArrays final Object  origMatrix[][]  )  [inline, static]
 

An utility method that concatenates many arrays to one. The type and the length of the returned array are derived from the type of the origMatrix parameter

Parameters:
origMatrix an array of arrays (a Matrix)
Returns:
an array with the concatenated values

Object cern::gp::util::ArrayUtil::concatArrays final Object[]  one,
final Object[]  two,
final Object[]  three,
Class  componentType
[inline, static]
 

An utility method that concatenates three arrays to one

Parameters:
one the first array
two the second array
three the third array
componentType the class of the component of the array to be returned
Returns:
an array of type componentType with the concatenation of the two arrays

Object cern::gp::util::ArrayUtil::concatArrays final Object[]  one,
final Object[]  two,
Class  componentType
[inline, static]
 

An utility method that concatenates two arrays to one

Parameters:
one the first array
two the second array
componentType the class of the component of the array to be returned
Returns:
an array of type componentType with the concatenation of the two arrays

void cern::gp::util::ArrayUtil::printArray final Object[]  array,
int  indent
[inline, static]
 

utility method, prints out an array using the toString() method of the members.

Parameters:
array can be null
indent the level of indents (tabs) that precede the output, can be negative

Object cern::gp::util::ArrayUtil::pruneNullElements Object[]  array,
boolean  onlyAtEnd
[inline, static]
 

prunes the null elements at the tail of an array. In the present implementation, onlyAtEnd must be true

Parameters:
array the array to be pruned
onlyAtEnd -- must be true

Object cern::gp::util::ArrayUtil::pruneNullElements Object[]  array  )  [inline, static]
 

A utility method that cuts off null-elements at the end of an array.

Returns:
a new array with only the non-null elements and the corresponding length

void cern::gp::util::ArrayUtil::sleep long  millis  )  [inline, static]
 

Utility method, sleeps for the indicated millis. Useful because it can be called in user programs without need to code the try/catch clauses.

Parameters:
millis the milliseconds to sleep

String cern::gp::util::ArrayUtil::toString final Object[]  array,
int  indent,
boolean  oneLine,
boolean  numbered
[inline, static]
 

utility method, transforms the array into a String that can either be multi-line or on one line.

Parameters:
array the array to be transformed, can be null
indent the number of tabs to be used for indenting
oneLine if true, a String containing a single line is returned, if false, return characters ("\n") are integrated into the returned string.
numbered if true, each element is preceded by its index in the array
Returns:
a string with the array contents, formated as requested


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:08:40 2009 for ACS Java API by doxygen 1.3.8