/[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 by ericb, Mon Feb 25 20:02:58 2002 UTC revision 1.20.2.1 by tromey, Sat Aug 7 00:27:06 2004 UTC
# Line 1  Line 1 
1  /* Boolean.java -- object wrapper for boolean  /* Boolean.java -- object wrapper for boolean
2     Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.     Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 49  import java.io.Serializable; Line 49  import java.io.Serializable;
49   * @since 1.0   * @since 1.0
50   * @status updated to 1.4   * @status updated to 1.4
51   */   */
52  public final class Boolean implements Serializable  public final class Boolean implements Serializable, Comparable<Boolean>
53  {  {
54    /**    /**
55     * Compatible with JDK 1.0.2+.     * Compatible with JDK 1.0.2+.
# Line 221  public final class Boolean implements Se Line 221  public final class Boolean implements Se
221        return false;        return false;
222      return "true".equalsIgnoreCase(System.getProperty(name));      return "true".equalsIgnoreCase(System.getProperty(name));
223    }    }
224    
225      /**
226       * If the String argument is "true", ignoring case, return true.
227       * Otherwise, return false.
228       *
229       * @param b String to parse
230       * @since 1.5
231       */
232      public static boolean parseBoolean(String b)
233      {
234        return "true".equalsIgnoreCase(b) ? true : false;
235      }
236    
237      /**
238       * This implements the comparison contract specified by Comparable.
239       * @see Comparable
240       * @since 1.5
241       */
242      public int compareTo(Boolean other)
243      {
244        return value == other.value ? 0 : (value ? 1 : -1);
245      }
246  }  }

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.20.2.1

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