org.pentaho.reporting.libraries.base.util

Class BulkDataUtility

public class BulkDataUtility extends Object

A utility class to support reordering operations of arrays.

Author: Thomas Morgner

Method Summary
static voidpushDown(Object[] data, boolean[] selection)
Pushes the selected elements down.
static voidpushDownSingleValue(Object[] data, Object selection)
Pushes the selected element down.
static voidpushUp(Object[] data, boolean[] selection)
Pushes the selected elements up.
static voidpushUpSingleValue(Object[] data, Object selection)
Pushes up the selected element.

Method Detail

pushDown

public static void pushDown(Object[] data, boolean[] selection)
Pushes the selected elements down. The elements are given in the data-array, while a selector on whether they should be pushed down is given in the selection array. The operation modifies the data-array.

Parameters: data the array holding the data-objects. selection the selection of which elements should be pushed down.

pushDownSingleValue

public static void pushDownSingleValue(Object[] data, Object selection)
Pushes the selected element down. The element is compared via reference-equality, so equals() will not be called. It is assumed that the selected object is part of the data-collection. The operation modifies the data-array.

Parameters: data the array holding the data-objects. selection the selectioned object that be pushed down.

pushUp

public static void pushUp(Object[] data, boolean[] selection)
Pushes the selected elements up. The elements are given in the data-array, while a selector on whether they should be pushed up is given in the selection array. The operation modifies the data-array.

Parameters: data the array holding the data-objects. selection the selection of which elements should be pushed up.

pushUpSingleValue

public static void pushUpSingleValue(Object[] data, Object selection)
Pushes up the selected element. The element is compared via reference-equality, so equals() will not be called. It is assumed that the selected object is part of the data-collection. The operation modifies the data-array.

Parameters: data the array holding the data-objects. selection the selectioned object that be pushed up.