/**
   * sorts the elements in this column so that the rows that were originally valid remain valid
   * after sorting Note - sort() supports only Comparable Objects or char arrays or byte arrays.
   * using sort with objects different than the above will throw an exception.
   */
  public void sort() {
    VIntIntHashMap newOrder = getNewOrder();
    elements = (VIntObjectHashMap) elements.reorder(newOrder);

    missing = missing.reorder(newOrder);
    empty = empty.reorder(newOrder);
  }
 /**
  * Reorders the data stored in this column in a new column. Does not change this column.
  *
  * <p>Algorithm: copy this column into the returned vlaue. for each pair (key, val) in <code>
  * newOrder</code>, if val is a valid row in this column, put the value mapped to it in row no.
  * key in the returned values.
  *
  * @param newOrder - an int to int hashmap, defining the new order for the returned column.
  * @return a SparseObjectColumn ordered according to <code>newOrder</code>.
  */
 public Column reorderRows(VIntIntHashMap newOrder) {
   SparseObjectColumn retVal = new SparseObjectColumn();
   retVal.elements = (VIntObjectHashMap) elements.reorder(newOrder);
   reorderRows(retVal, newOrder);
   return retVal;
 }