1 package com.quadcap.sql.index; 2 3 40 41 import java.io.IOException ; 42 43 import com.quadcap.util.ConfigNumber; 44 import com.quadcap.util.Debug; 45 import com.quadcap.util.Util; 46 47 52 public class Comparator { 53 public static Comparator compare = new Comparator(); 54 55 public int compare(byte[] a, int aoff, int alen, 56 byte[] b, int boff, int blen) 57 { 58 int ret = Util.compareBytes(a, aoff, alen, b, boff, blen); 59 if (Trace.bit(4)) { 61 Debug.println(0, "compare(" + Util.strBytes(a, aoff, alen) + ", " + 62 Util.strBytes(b, boff, blen) + ") = " + ret); 63 } 64 return ret; 66 } 67 68 public int compare(byte[] a, byte[] b) { 69 return compare(a, 0, a.length, b, 0, b.length); 70 } 71 72 public String toString(byte[] key, int off, int len) { 73 return new String (key, off, len); 74 } 75 } 76 | Popular Tags |