示例#1
0
 public int compare(long[] left, long[] right) {
   int minLength = min(left.length, right.length);
   for (int i = 0; i < minLength; i++) {
     int result = Longs.compare(left[i], right[i]);
     if (result != 0) {
       return result;
     }
   }
   return left.length - right.length;
 }
示例#2
0
 @Override
 public int lastIndexOf(Object target) {
   // Overridden to prevent a ton of boxing
   if (target instanceof Long) {
     int i = Longs.lastIndexOf(array, (Long) target, start, end);
     if (i >= 0) {
       return i - start;
     }
   }
   return -1;
 }
示例#3
0
 @Override
 public boolean contains(Object target) {
   // Overridden to prevent a ton of boxing
   return (target instanceof Long) && Longs.indexOf(array, (Long) target, start, end) != -1;
 }