(String s)
| 191 | } |
| 192 | |
| 193 | @Override |
| 194 | public int compareTo(String s) { |
| 195 | if (this == s) return 0; |
| 196 | |
| 197 | int idx = 0; |
| 198 | int result; |
| 199 | |
| 200 | int end = (length < s.length ? length : s.length); |
| 201 | |
| 202 | while (idx < end) { |
| 203 | if ((result = charAt(idx) - s.charAt(idx)) != 0) { |
| 204 | return result; |
| 205 | } |
| 206 | idx++; |
| 207 | } |
| 208 | return length - s.length; |
| 209 | } |
| 210 | |
| 211 | public int compareToIgnoreCase(String s) { |
| 212 | if (this == s) return 0; |