Class BulkDataUtility


  • public final class BulkDataUtility
    extends Object
    A utility class to support reordering operations of arrays.
    Author:
    Thomas Morgner
    • Method Detail

      • 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.
      • 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.
      • 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.
      • 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.