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

Diff of /classpath/java/lang/String.java

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

revision 1.58.2.12 by tromey, Sun Sep 25 02:55:12 2005 UTC revision 1.58.2.13 by tromey, Tue Sep 27 16:46:46 2005 UTC
# Line 148  public final class String Line 148  public final class String
148     * compatibility with Sun's JDK.     * compatibility with Sun's JDK.
149     */     */
150    private static final class CaseInsensitiveComparator    private static final class CaseInsensitiveComparator
151      implements Comparator, Serializable      implements Comparator<String>, Serializable
152    {    {
153      /**      /**
154       * Compatible with JDK 1.2.       * Compatible with JDK 1.2.
# Line 172  public final class String Line 172  public final class String
172       * @throws ClassCastException if either argument is not a String       * @throws ClassCastException if either argument is not a String
173       * @see #compareToIgnoreCase(String)       * @see #compareToIgnoreCase(String)
174       */       */
175      public int compare(Object o1, Object o2)      public int compare(String o1, String o2)
176      {      {
177        return ((String) o1).compareToIgnoreCase((String) o2);        return o1.compareToIgnoreCase(o2);
178      }      }
179    } // class CaseInsensitiveComparator    } // class CaseInsensitiveComparator
180    
# Line 186  public final class String Line 186  public final class String
186     * @see Collator#compare(String, String)     * @see Collator#compare(String, String)
187     * @since 1.2     * @since 1.2
188     */     */
189    public static final Comparator CASE_INSENSITIVE_ORDER    public static final Comparator<String> CASE_INSENSITIVE_ORDER
190      = new CaseInsensitiveComparator();      = new CaseInsensitiveComparator();
191    
192    /**    /**

Legend:
Removed from v.1.58.2.12  
changed lines
  Added in v.1.58.2.13

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