GenaralCompatator
类如下  private static class GenaralCompatator
      implements Comparator
  {    private String methodName = null;
    private int asc = 1;    public GenaralCompatator(String methodName, boolean asc)
    {
      this.methodName = methodName;
      if (!asc)
      {
        this.asc = -1;
      }
    }    public GenaralCompatator(String methodName, String compType)
    {
      this(methodName, true);
    }    public int compare(Object o1, Object o2)
    {      int returnValue = 0;
      try
      {
        java.lang.reflect.Method method = o1.getClass().getMethod(methodName, null);        Object f1 = method.invoke(o1, null);
        Object f2 = method.invoke(o2, null);        method = f1.getClass().getMethod("compareTo", new Class[]
                                         {f1.getClass()});
        Object returnObj = method.invoke(f1, new Object[]
                                         {f2});
        Integer toInteger = (Integer) (returnObj);
        returnValue = asc * (toInteger.intValue());
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
      return returnValue;
    }
  }