예제 #1
0
 public int compare(char[] left, char[] right) {
   int minLength = min(left.length, right.length);
   for (int i = 0; i < minLength; i++) {
     int result = Chars.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 Character) {
     int i = Chars.lastIndexOf(array, (Character) 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 Character)
       && Chars.indexOf(array, (Character) target, start, end) != -1;
 }