Пример #1
0
 /**
  * Compare the positions of two rows.
  *
  * @param rowData the first row
  * @param compare the second row
  * @return 0 if both rows are equal, -1 if the first row is smaller, otherwise 1
  */
 int compareKeys(SearchRow rowData, SearchRow compare) {
   long k1 = rowData.getKey();
   long k2 = compare.getKey();
   if (k1 == k2) {
     if (isMultiVersion) {
       int v1 = rowData.getVersion();
       int v2 = compare.getVersion();
       return MathUtils.compareInt(v2, v1);
     }
     return 0;
   }
   return k1 > k2 ? 1 : -1;
 }
Пример #2
0
 @Override
 protected int compareSecure(Value o, CompareMode mode) {
   ValueByte v = (ValueByte) o;
   return MathUtils.compareInt(value, v.value);
 }