Sample Sorting Code

The following sample code can be used to get column values from object1 and object2.

public int compare(Object object1,  Object object2)
{
    // Logic to get column values to compare from object1 and 
object2
     // Get sort info keys
    Map sortKeys = getSortKeys ( );
    // Get column key name defined to get column values from 
object1 and object2
    String columnKey = (String) sortKeys.get("columnKey");
    // Get column values from object1 and object2
    Map m1 = (Map)object1;
    Map m2 = (Map)object2;
    String columnValue1 = (String)m1.get(columnKey);
    String columnValue2 = (String)m2.get(columnKey);
    // Code to custom compare columnValue1 and 2 goes here.
    .
    .
    .
}