1 18 package org.apache.geronimo.interop.rmi.iiop; 19 20 import java.lang.reflect.*; 21 import java.util.*; 22 23 26 public class FieldComparator implements Comparator 27 { 28 public static final FieldComparator SINGLETON = new FieldComparator(); 29 30 public int compare(Object x, Object y) 31 { 32 Field a = (Field)x; 33 Field b = (Field)y; 34 if (a.getType().isPrimitive()) 35 { 36 if (b.getType().isPrimitive()) 37 { 38 return a.getName().compareTo(b.getName()); 39 } 40 else 41 { 42 return -1; 43 } 44 } 45 else 46 { 47 if (b.getType().isPrimitive()) 48 { 49 return 1; 50 } 51 else 52 { 53 return a.getName().compareTo(b.getName()); 54 } 55 } 56 } 57 58 public boolean equals(Object x) 59 { 60 return false; 62 } 63 } 64 65 | Popular Tags |