Home
last modified time | relevance | path

Searched refs:hash (Results 1 – 25 of 48) sorted by relevance

12

/libcore/ojluni/src/main/java/java/util/
DHashtable.java337 int hash = key.hashCode(); in containsKey() local
338 int index = (hash & 0x7FFFFFFF) % tab.length; in containsKey()
340 if ((e.hash == hash) && e.key.equals(key)) { in containsKey()
365 int hash = key.hashCode(); in get() local
366 int index = (hash & 0x7FFFFFFF) % tab.length; in get()
368 if ((e.hash == hash) && e.key.equals(key)) { in get()
414 int index = (e.hash & 0x7FFFFFFF) % newCapacity; in rehash()
421 private void addEntry(int hash, K key, V value, int index) { in addEntry() argument
430 hash = key.hashCode(); in addEntry()
431 index = (hash & 0x7FFFFFFF) % tab.length; in addEntry()
[all …]
DHashMap.java279 final int hash; field in HashMap.Node
284 Node(int hash, K key, V value, Node<K,V> next) { in Node() argument
285 this.hash = hash; in Node()
336 static final int hash(Object key) { in hash() method in HashMap
514 putVal(hash(key), key, value, false, evict); in putMapEntries()
556 return (e = getNode(hash(key), key)) == null ? null : e.value; in get()
566 final Node<K,V> getNode(int hash, Object key) { in getNode() argument
569 (first = tab[(n - 1) & hash]) != null) { in getNode()
570 if (first.hash == hash && // always check first node in getNode()
575 return ((TreeNode<K,V>)first).getTreeNode(hash, key); in getNode()
[all …]
DLinkedHashMap.java218 LinkedHashMapEntry(int hash, K key, V value, Node<K,V> next) { in LinkedHashMapEntry() argument
219 super(hash, key, value, next); in LinkedHashMapEntry()
279 Node<K,V> newNode(int hash, K key, V value, Node<K,V> e) { in newNode() argument
281 new LinkedHashMapEntry<K,V>(hash, key, value, e); in newNode()
289 new LinkedHashMapEntry<K,V>(q.hash, q.key, q.value, next); in replacementNode()
294 TreeNode<K,V> newTreeNode(int hash, K key, V value, Node<K,V> next) { in newTreeNode() argument
295 TreeNode<K,V> p = new TreeNode<K,V>(hash, key, value, next); in newTreeNode()
302 TreeNode<K,V> t = new TreeNode<K,V>(q.hash, q.key, q.value, next); in replacementTreeNode()
325 removeNode(hash(key), key, null, false, true); in afterNodeInsertion()
464 if ((e = getNode(hash(key), key)) == null) in get()
[all …]
DWeakHashMap.java297 final int hash(Object k) { in hash() method in WeakHashMap
322 int i = indexFor(e.hash, table.length); in expungeStaleEntries()
396 int h = hash(k); in get()
401 if (e.hash == h && eq(k, e.get())) in get()
426 int h = hash(k); in getEntry()
430 while (e != null && !(e.hash == h && eq(k, e.get()))) in getEntry()
449 int h = hash(k); in put()
454 if (h == e.hash && eq(k, e.get())) { in put()
523 int i = indexFor(e.hash, dest.length); in transfer()
591 int h = hash(k); in remove()
[all …]
DIdentityHashMap.java293 private static int hash(Object x, int length) { in hash() method in IdentityHashMap
328 int i = hash(k, len); in get()
352 int i = hash(k, len); in containsKey()
393 int i = hash(k, len); in containsMapping()
425 int i = hash(k, len); in put()
479 int i = hash(key, newLength); in resize()
522 int i = hash(k, len); in remove()
554 int i = hash(k, len); in removeMapping()
599 int r = hash(item, len); in closeDeletion()
790 int r = hash(item, len); in remove()
[all …]
DLocale.java848 private final int hash; field in Locale.LocaleKey
859 hash = h; in LocaleKey()
871 if (hash != other.hash || !base.equals(other.base)) { in equals()
882 return hash; in hashCode()
3017 private volatile int hash = 0; field in Locale.LanguageRange
3274 if (hash == 0) { in hashCode()
3279 hash = result; in hashCode()
3281 return hash; in hashCode()
3304 return hash == other.hash in equals()
/libcore/ojluni/src/main/java/sun/security/x509/
DDistributionPointName.java214 int hash = hashCode; in hashCode() local
215 if (hash == 0) { in hashCode()
216 hash = 1; in hashCode()
218 hash += fullName.hashCode(); in hashCode()
221 hash += relativeName.hashCode(); in hashCode()
223 hashCode = hash; in hashCode()
225 return hash; in hashCode()
DDistributionPoint.java344 int hash = hashCode; in hashCode() local
345 if (hash == 0) { in hashCode()
346 hash = 1; in hashCode()
348 hash += fullName.hashCode(); in hashCode()
351 hash += relativeName.hashCode(); in hashCode()
354 hash += crlIssuer.hashCode(); in hashCode()
359 hash += i; in hashCode()
363 hashCode = hash; in hashCode()
365 return hash; in hashCode()
/libcore/luni/src/main/java/libcore/reflect/
DAnnotationMember.java260 int hash = name.hashCode() * 127; in hashCode() local
264 return hash ^ Arrays.hashCode((int[])value); in hashCode()
266 return hash ^ Arrays.hashCode((byte[])value); in hashCode()
268 return hash ^ Arrays.hashCode((short[])value); in hashCode()
270 return hash ^ Arrays.hashCode((long[])value); in hashCode()
272 return hash ^ Arrays.hashCode((char[])value); in hashCode()
274 return hash ^ Arrays.hashCode((boolean[])value); in hashCode()
276 return hash ^ Arrays.hashCode((float[])value); in hashCode()
278 return hash ^ Arrays.hashCode((double[])value); in hashCode()
280 return hash ^ Arrays.hashCode((Object[])value); in hashCode()
[all …]
DAnnotationFactory.java241 int hash = 0; in hashCode() local
243 hash += element.hashCode(); in hashCode()
245 return hash; in hashCode()
/libcore/ojluni/src/main/java/java/nio/file/attribute/
DAclEntry.java72 private volatile int hash; field in AclEntry
359 private static int hash(int h, Object o) { in hash() method in AclEntry
372 if (hash != 0) in hashCode()
373 return hash; in hashCode()
375 h = hash(h, who); in hashCode()
376 h = hash(h, perms); in hashCode()
377 h = hash(h, flags); in hashCode()
378 hash = h; in hashCode()
379 return hash; in hashCode()
/libcore/ojluni/src/main/java/sun/util/calendar/
DEra.java135 private int hash = 0; field in Era
138 if (hash == 0) { in hashCode()
139 hash = name.hashCode() ^ abbr.hashCode() ^ (int)since ^ (int)(since >> 32) in hashCode()
142 return hash; in hashCode()
DCalendarDate.java414 long hash = ((((((long)year - 1970) * 12) + (month - 1)) * 30) + dayOfMonth) * 24; in hashCode() local
415 hash = ((((((hash + hours) * 60) + minutes) * 60) + seconds) * 1000) + millis; in hashCode()
416 hash -= zoneOffset; in hashCode()
424 return (int) hash * (int)(hash >> 32) ^ era ^ normalized ^ zone; in hashCode()
/libcore/ojluni/src/main/java/sun/util/locale/
DBaseLocale.java48 private volatile int hash = 0; field in BaseLocale
155 int h = hash; in hashCode()
162 hash = h; in hashCode()
173 private final int hash; field in BaseLocale.Key
196 hash = h; in Key()
242 hash = h; in Key()
252 if (obj instanceof Key && this.hash == ((Key)obj).hash) { in equals()
277 return hash; in hashCode()
/libcore/luni/src/test/java/libcore/java/util/
DObjectsTest.java66 assertEquals(Arrays.hashCode(new Object[0]), Objects.hash()); in test_hash()
67 assertEquals(31, Objects.hash((Object) null)); in test_hash()
68 assertEquals(0, Objects.hash((Object[]) null)); in test_hash()
69 assertEquals(-1107615551, Objects.hash("hello", "world")); in test_hash()
70 assertEquals(23656287, Objects.hash("hello", "world", null)); in test_hash()
/libcore/ojluni/src/main/java/java/lang/reflect/
DWeakCache.java299 private final int hash; field in WeakCache.CacheValue
303 this.hash = System.identityHashCode(value); // compare by identity in CacheValue()
308 return hash; in hashCode()
341 private final int hash; field in WeakCache.CacheKey
345 this.hash = System.identityHashCode(key); // compare by identity in CacheKey()
350 return hash; in hashCode()
DProxy.java455 private final int hash; field in Proxy.Key1
459 this.hash = intf.hashCode(); in Key1()
464 return hash; in hashCode()
482 private final int hash; field in Proxy.Key2
487 hash = 31 * intf1.hashCode() + intf2.hashCode(); in Key2()
493 return hash; in hashCode()
514 private final int hash; field in Proxy.KeyX
519 hash = Arrays.hashCode(interfaces); in KeyX()
528 return hash; in hashCode()
/libcore/ojluni/src/main/java/java/security/cert/
DCertificate.java70 private int hash = -1; // Default to -1 field in Certificate
129 int h = hash; in hashCode()
136 hash = h; in hashCode()
/libcore/ojluni/src/main/java/java/util/concurrent/
DExchanger.java314 int hash; // Pseudo-random for spins field in Exchanger.Node
377 for (int h = p.hash, spins = SPINS;;) { in arenaExchange()
382 p.hash = h; in arenaExchange()
410 p.hash = h; in arenaExchange()
483 int h = p.hash; in slotExchange()
513 p.hash = h; in slotExchange()
/libcore/ojluni/src/main/java/java/time/temporal/
DValueRange.java401 long hash = minSmallest + minLargest << 16 + minLargest >> 48 + maxSmallest << 32 + in hashCode() local
403 return (int) (hash ^ (hash >>> 32)); in hashCode()
/libcore/luni/src/main/native/
Dorg_apache_harmony_xml_ExpatParser.cpp58 int hash; member
241 int hash = 0; in hashString() local
244 hash = hash * 31 + *s++; in hashString()
247 return hash; in hashString()
258 static InternedString* newInternedString(JNIEnv* env, const char* bytes, int hash) { in newInternedString() argument
277 wrapper->hash = hash; in newInternedString()
352 static jstring findInternedString(InternedString** bucket, const char* s, int hash) { in findInternedString() argument
355 if (current->hash != hash) continue; in findInternedString()
370 int hash = hashString(s); in internString() local
371 int bucketIndex = hash & (BUCKET_COUNT - 1); in internString()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigDecimalTest.java355 BigDecimal hash = new BigDecimal("1.00"); in test_hashCode() local
358 hash.hashCode() != hash2.hashCode() && !hash.equals(hash2)); in test_hashCode()
361 hash.hashCode() != hash2.hashCode() && !hash.equals(hash2)); in test_hashCode()
364 assertTrue("hashCode of 1.00 and 1.00(bigInteger) is not equal", hash in test_hashCode()
366 && hash.equals(hash2)); in test_hashCode()
367 hash = new BigDecimal(value, 2); in test_hashCode()
369 assertTrue("hashCode of 123459.08 and -1233456.0000 is not equal", hash in test_hashCode()
371 && !hash.equals(hash2)); in test_hashCode()
373 assertTrue("hashCode of 123459.08 and -123459.08 is not equal", hash in test_hashCode()
375 && !hash.equals(hash2)); in test_hashCode()
/libcore/ojluni/src/main/java/java/net/
DURI.java491 private volatile transient int hash; // Zero ==> undefined field in URI
1451 if (hash != 0) in hashCode()
1452 return hash; in hashCode()
1454 h = hash(h, fragment); in hashCode()
1456 h = hash(h, schemeSpecificPart); in hashCode()
1458 h = hash(h, path); in hashCode()
1459 h = hash(h, query); in hashCode()
1461 h = hash(h, userInfo); in hashCode()
1465 h = hash(h, authority); in hashCode()
1468 hash = h; in hashCode()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DMessageDigest2Test.java156 byte[] hash = sha.digest(data); in testSerializationSHA_DATA_2()
157 assertTrue("SHA_DATA_2 NOT ok", Arrays.equals(hash, SHA_DATA_2)); in testSerializationSHA_DATA_2()
199 byte[] hash = sha.digest(data); in testSerializationSHA_DATA_1()
200 assertTrue("SHA_DATA_1 NOT ok", Arrays.equals(hash, SHA_DATA_1)); in testSerializationSHA_DATA_1()
/libcore/ojluni/src/main/java/java/lang/
DProcessEnvironment.java434 int hash = 0;
436 hash = 31 * hash + x[i];
437 return hash;

12