223 |
} |
} |
224 |
|
|
225 |
/** |
/** |
226 |
* If the String argument is "true", ignoring case, return true. |
* This implements the comparison contract specified by Comparable. |
227 |
* Otherwise, return false. |
* @see Comparable |
|
* |
|
|
* @param b String to parse |
|
228 |
* @since 1.5 |
* @since 1.5 |
229 |
*/ |
*/ |
230 |
public static boolean parseBoolean(String b) |
public int compareTo(Boolean other) |
231 |
{ |
{ |
232 |
return "true".equalsIgnoreCase(b) ? true : false; |
return value == other.value ? 0 : (value ? 1 : -1); |
233 |
} |
} |
234 |
|
|
235 |
/** |
/** |
236 |
* This implements the comparison contract specified by Comparable. |
* If the String argument is "true", ignoring case, return true. |
237 |
* @see Comparable |
* Otherwise, return false. |
238 |
|
* |
239 |
|
* @param b String to parse |
240 |
* @since 1.5 |
* @since 1.5 |
241 |
*/ |
*/ |
242 |
public int compareTo(Boolean other) |
public static boolean parseBoolean(String b) |
243 |
{ |
{ |
244 |
return value == other.value ? 0 : (value ? 1 : -1); |
return "true".equalsIgnoreCase(b) ? true : false; |
245 |
} |
} |
246 |
} |
} |