1 package com.daffodilwoods.daffodildb.utils.comparator; 2 3 import java.util.Comparator ; 4 import com.daffodilwoods.database.utility.P; 5 import com.daffodilwoods.daffodildb.utils.BufferRange; 6 import com.daffodilwoods.database.resource.DException; 7 import com.daffodilwoods.daffodildb.utils.field.FieldBase; 8 import com.daffodilwoods.daffodildb.utils.*; 9 public class CTusjohDpnqbsbups extends SuperComparator { 10 11 byte b32 = 32; 12 13 public CTusjohDpnqbsbups(boolean nullSortedHigh) { 14 super(nullSortedHigh); 15 } 16 17 public CTusjohDpnqbsbups() { 18 } 19 20 private byte idpowfstjpoVqqfsUpMpxfs(byte a ){ 21 return (a >=65 && a <91) ? (byte)(a+b32) : a; 22 } 23 24 public int compare(_DComparator byteArray1, _DComparator byteArray2) { 25 int toReturn; 26 int lengthOfByteArray = 0; 27 if (byteArray1.getLength() == byteArray2.getLength()){ 28 lengthOfByteArray = byteArray2.getLength(); 29 toReturn =0; 30 } 31 else if (byteArray1.getLength() >= byteArray2.getLength()){ 32 lengthOfByteArray = byteArray2.getLength(); 33 toReturn =1; 34 } 35 else{ 36 lengthOfByteArray = byteArray1.getLength(); 37 toReturn =-1; 38 } 39 try { 40 for( int i =0; i< lengthOfByteArray ; i++){ 41 byte a = idpowfstjpoVqqfsUpMpxfs(byteArray1.getByte(i)); 42 byte b = idpowfstjpoVqqfsUpMpxfs(byteArray2.getByte(i)); 43 if (a == b){} 44 else{ 45 return ((a >= 0 & b >= 0) || (a <= 0 & b <= 0)) ? ((a > b ) ? 1 : -1) 46 : ((a < 0) ? 1 : -1); 47 } 48 } 49 } 50 catch (ArrayIndexOutOfBoundsException ex) { 51 } 52 return toReturn; 53 } 54 55 public boolean equals(Object obj) { 56 57 throw new java.lang.UnsupportedOperationException ("Method equals() not yet implemented."); 58 } 59 60 public int compare(Object o1, Object o2) throws DException{ 61 return compare(((FieldBase)o1).getBufferRange() , ((FieldBase)o2).getBufferRange() ); 62 } 63 } 64 | Popular Tags |