/[classpath]/classpath/java/util/Collections.java
ViewVC logotype

Diff of /classpath/java/util/Collections.java

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

revision 1.22 by ericb, Mon Oct 22 03:46:07 2001 UTC revision 1.23 by ericb, Thu Oct 25 07:34:19 2001 UTC
# Line 716  public class Collections Line 716  public class Collections
716    
717    /**    /**
718     * Returns an array list holding the elements visited by a given     * Returns an array list holding the elements visited by a given
719     * Enumeration. This method exists for interoperatbility between legacy     * Enumeration. This method exists for interoperability between legacy
720     * APIs and the new Collection API.     * APIs and the new Collection API.
721     *     *
722     * @param e the enumeration to put in a list     * @param e the enumeration to put in a list
# Line 906  public class Collections Line 906  public class Collections
906       */       */
907      public boolean contains(Object o)      public boolean contains(Object o)
908      {      {
909        return n > 0 && equals(element, o);        return n > 0 && equals(o, element);
910      }      }
911    
912      /**      /**
# Line 914  public class Collections Line 914  public class Collections
914       */       */
915      public int indexOf(Object o)      public int indexOf(Object o)
916      {      {
917        return n > 0 && equals(element, o) ? 0 : -1;        return (n > 0 && equals(o, element)) ? 0 : -1;
918      }      }
919    
920      /**      /**
# Line 922  public class Collections Line 922  public class Collections
922       */       */
923      public int lastIndexOf(Object o)      public int lastIndexOf(Object o)
924      {      {
925        return equals(element, o) ? n - 1 : -1;        return equals(o, element) ? n - 1 : -1;
926      }      }
927    
928      /**      /**
# Line 1322  public class Collections Line 1322  public class Collections
1322       */       */
1323      public boolean contains(Object o)      public boolean contains(Object o)
1324      {      {
1325        return equals(element, o);        return equals(o, element);
1326      }      }
1327    
1328      /**      /**
# Line 1432  public class Collections Line 1432  public class Collections
1432       */       */
1433      public boolean contains(Object o)      public boolean contains(Object o)
1434      {      {
1435        return equals(element, o);        return equals(o, element);
1436      }      }
1437    
1438      /**      /**
# Line 1461  public class Collections Line 1461  public class Collections
1461       */       */
1462      public int indexOf(Object o)      public int indexOf(Object o)
1463      {      {
1464        return equals(element, o) ? 0 : -1;        return equals(o, element) ? 0 : -1;
1465      }      }
1466    
1467      /**      /**
# Line 1469  public class Collections Line 1469  public class Collections
1469       */       */
1470      public int lastIndexOf(Object o)      public int lastIndexOf(Object o)
1471      {      {
1472        return equals(element, o) ? 0 : -1;        return equals(o, element) ? 0 : -1;
1473      }      }
1474    
1475      /**      /**

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

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