Changeset 1391 for branches/GNU/src/gcc/libjava/java/util/BitSet.java
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (22 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
libjava/java/util/BitSet.java (modified) (2 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/libjava/java/util/BitSet.java
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r1390 r1391 399 399 * of <code>k</code>) if and only if 400 400 * 401 * < pre>402 * ((k/64) < bits.length) && ((bits[k/64] & (1L <<(bit % 64))) != 0)403 * </ pre>401 * < 402 * (bit % 64))) != 0) 403 * </e> 404 404 * 405 405 * Then the following definition of the hashCode method 406 406 * would be a correct implementation of the actual algorithm: 407 407 * 408 * <pre> 409 * public int hashCode() { 410 * long h = 1234; 411 * for (int i = bits.length-1; i>=0; i--) { 412 * h ^= bits[i] * (i + 1); 413 * } 414 * return (int)((h >> 32) ^ h); 415 * } 416 * </pre> 408 * 409 <pre>public int hashCode() 410 { 411 long h = 1234; 412 for (int i = bits.length-1; i >= 0; i--) 413 { 414 h ^= bits[i] * (i + 1); 415 } 416 417 return (int)((h >> 32) ^ h); 418 }</pre> 417 419 * 418 420 * Note that the hash code values changes, if the set is changed. … … 527 529 * (inclusive). If there is none, -1 is returned. You can iterate over 528 530 * all true bits with this loop:<br> 529 * <pre> 530 * for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) 531 * { // operate on i here } 532 * </pre> 531 * 532 <pre>for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) 533 { 534 // operate on i here 535 }</pre> 533 536 * 534 537 * @param from the start location -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
