/[classpath]/classpath/java/lang/Boolean.java
ViewVC logotype

Diff of /classpath/java/lang/Boolean.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20.2.6 by gnu_andrew, Tue Aug 2 20:12:22 2005 UTC revision 1.20.2.7 by gnu_andrew, Tue Sep 20 18:46:27 2005 UTC
# Line 223  public final class Boolean implements Se Line 223  public final class Boolean implements Se
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  }  }

Legend:
Removed from v.1.20.2.6  
changed lines
  Added in v.1.20.2.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26