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.daffodildb.utils.field.FieldBase; 7 import com.daffodilwoods.database.resource.DException; 8 import com.daffodilwoods.daffodildb.utils.*; 9 10 public class CTfotjujwfTusjohDpnqbsbups extends SuperComparator { 11 12 public CTfotjujwfTusjohDpnqbsbups(boolean nullSortedHigh) { 13 super(nullSortedHigh); 14 } 15 public CTfotjujwfTusjohDpnqbsbups() { 16 } 17 18 public int compare(_DComparator byteArray1, _DComparator byteArray2) { 19 int toReturn; 20 int lengthOfByteArray = 0; 21 if (byteArray1.getLength() == byteArray2.getLength()){ 22 lengthOfByteArray = byteArray2.getLength(); 23 toReturn =0; 24 } 25 else if (byteArray1.getLength() >= byteArray2.getLength()){ 26 lengthOfByteArray = byteArray2.getLength(); 27 toReturn =1; 28 } 29 else{ 30 lengthOfByteArray = byteArray1.getLength(); 31 toReturn =-1; 32 } 33 try { 34 for( int i =0; i< lengthOfByteArray ; i++){ 35 byte a = byteArray1.getByte(i); 36 byte b = byteArray2.getByte(i); 37 if (a == b){} 38 else 39 return ((a >= 0 & b >= 0) || (a <= 0 & b <= 0)) ? ((a > b ) ? 1 : -1) 40 : ((a < 0) ? 1 : -1); 41 } 42 } 43 catch (ArrayIndexOutOfBoundsException ex) { 44 } 45 return toReturn; 46 } 47 48 public boolean equals(Object obj) { 49 50 throw new java.lang.UnsupportedOperationException ("Method equals() not yet implemented."); 51 } 52 } 53 | Popular Tags |