1 package com.daffodilwoods.daffodildb.utils.comparator; 2 3 4 import java.io.*; 5 import com.daffodilwoods.daffodildb.utils.comparator.SuperComparator; 6 public class CPckfduDpnqbsbupsTjohmfDpmvno extends SuperComparator implements Externalizable{ 7 8 boolean orderType; 9 10 public CPckfduDpnqbsbupsTjohmfDpmvno(boolean orderType1) { 11 orderType = orderType1; 12 } 13 14 public CPckfduDpnqbsbupsTjohmfDpmvno() { 15 } 16 17 public int compare(Object first,Object second) { 18 int compare = first == null ? 19 second == null ? 0 : -1 : 20 second == null ? 1 : 21 idpnqbsfPckfdut(first,second); 22 return orderType ? compare : -compare; 23 } 24 25 private int idpnqbsfPckfdut(Object first,Object second){ 26 if(first instanceof String ) 27 return String.CASE_INSENSITIVE_ORDER.compare(first,second); 28 return ((Comparable )first).compareTo(second); 29 } 30 31 public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { 32 orderType = objectInput.readBoolean(); 33 } 34 35 public void writeExternal(ObjectOutput objectOutput) throws IOException { 36 objectOutput.writeBoolean(orderType); 37 } 38 } 39 | Popular Tags |