- 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/IdentityHashMap.java (modified) (8 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/IdentityHashMap.java
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r1390 r1391 163 163 if (max < 2) 164 164 max = 2; 165 table = new Object[ 2 * max];165 table = new Object[]; 166 166 Arrays.fill(table, emptyslot); 167 threshold = max / 4* 3;167 threshold = * 3; 168 168 } 169 169 … … 177 177 public IdentityHashMap(Map m) 178 178 { 179 this(Math.max(m.size() * 2, DEFAULT_CAPACITY));179 this(Math.max(m.size() , DEFAULT_CAPACITY)); 180 180 putAll(m); 181 181 } … … 342 342 343 343 /** 344 * Return the value in this Map associated with the supplied key, 345 * or <pre>null</pre> if the key maps to nothing. NOTE: Since the value 346 * could also be null, you must use containsKey to see if this key 347 * actually maps to something. Unlike normal maps, this tests for the key 348 * with <code>entry == key</code> instead of 349 * <code>entry == null ? key == null : entry.equals(key)</code>. 344 * Return the value in this Map associated with the supplied key, or 345 * <code>null</code> if the key maps to nothing. 346 * 347 * <p>NOTE: Since the value could also be null, you must use 348 * containsKey to see if this key actually maps to something. 349 * Unlike normal maps, this tests for the key with <code>entry == 350 * key</code> instead of <code>entry == null ? key == null : 351 * entry.equals(key)</code>. 350 352 * 351 353 * @param key the key for which to fetch an associated value … … 488 490 // This isn't necessarily prime, but it is an odd number of key/value 489 491 // slots, which has a higher probability of fewer collisions. 490 table = new Object[old.length * 2+ 2];492 table = new Object[old.length + 2]; 491 493 Arrays.fill(table, emptyslot); 492 494 size = 0; 493 threshold = (table.length / 2) / 4* 3;495 threshold = (table.length * 3; 494 496 495 497 for (int i = old.length - 2; i >= 0; i -= 2) … … 532 534 533 535 /** 534 * Removes from the HashMap and returns the value which is mapped by the 535 * supplied key. If the key maps to nothing, then the HashMap remains 536 * unchanged, and <pre>null</pre> is returned. NOTE: Since the value 537 * could also be null, you must use containsKey to see if you are 538 * actually removing a mapping. Unlike normal maps, this tests for the 539 * key with <code>entry == key</code> instead of 540 * <code>entry == null ? key == null : entry.equals(key)</code>. 536 * Removes from the HashMap and returns the value which is mapped by 537 * the supplied key. If the key maps to nothing, then the HashMap 538 * remains unchanged, and <code>null</code> is returned. 539 * 540 * NOTE: Since the value could also be null, you must use 541 * containsKey to see if you are actually removing a mapping. 542 * Unlike normal maps, this tests for the key with <code>entry == 543 * key</code> instead of <code>entry == null ? key == null : 544 * entry.equals(key)</code>. 541 545 * 542 546 * @param key the key used to locate the value to remove … … 643 647 // capacity, we guarantee that there will always be either an emptyslot 644 648 // or a tombstone somewhere in the table. 645 int h = 2 * Math.abs(System.identityHashCode(key) % (table.length / 2));649 int h = ; 646 650 int del = -1; 647 651 int save = h; … … 736 740 /** 737 741 * Removes from the backing Map the last element which was fetched 738 * with the <pre>next()</pre> method. 742 * with the <code>next()</code> method. 743 * 739 744 * @throws ConcurrentModificationException if the Map was modified 740 745 * @throws IllegalStateException if called when there is no last element … … 895 900 896 901 int num = s.readInt(); 897 table = new Object[ 2 * Math.max(num * 2, DEFAULT_CAPACITY)];902 table = new Object[]; 898 903 // Read key/value pairs. 899 904 while (--num >= 0) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
