private static int hashCode(Object key) { if (ourIsCompatibilityMode && String.class == key.getClass()) { int hash = 0; String str = (String) key; for (int i = 0; i < str.length(); i++) { hash = hash*33 + str.charAt(i); } return hash; } else if (key.getClass() == File.class) { return hashCode(((File) key).getPath()); } return key.hashCode(); }
private static int hashCode(Object key) { if (ourIsCompatibilityMode && String.class == key.getClass()) { int hash = 0; String str = (String) key; for (int i = 0; i < str.length(); i++) { hash = hash*33 + str.charAt(i); } return hash; } else if (key.getClass() == File.class) { return hashCode(((File) key).getPath()); } return key.hashCode(); }
private static int hashCode(Object key) { if (ourIsCompatibilityMode && String.class == key.getClass()) { int hash = 0; String str = (String) key; for (int i = 0; i < str.length(); i++) { hash = hash*33 + str.charAt(i); } return hash; } else if (key.getClass() == File.class) { return hashCode(((File) key).getPath()); } return key.hashCode(); }
public Object get(Object key) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (hash == entry.hash && eq(key, entry.key)) { return entry.value; } entry = entry.next; } return null; }
public Object get(Object key) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (hash == entry.hash && eq(key, entry.key)) { return entry.value; } entry = entry.next; } return null; }
public Object get(Object key) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (hash == entry.hash && eq(key, entry.key)) { return entry.getValue(); } entry = entry.next; } return null; }
public Object remove(Object key) { if (isEmpty()) { return null; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; TableEntry previousEntry = null; while (entry != null) { if (entry.hash == hash && entry.key.equals(key)) { if (previousEntry != null) { previousEntry.next = entry.next; } else { myTable[index] = entry.next; } myEntryCount--; myModCount++; return entry.getValue(); } previousEntry = entry; entry = entry.next; } return null; }
public boolean containsKey(Object key) { if (isEmpty()) { return false; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (entry.hash == hash && eq(key, entry.key)) { return true; } entry = entry.next; } return false; }
public Object remove(Object key) { if (isEmpty()) { return null; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; TableEntry previousEntry = null; while (entry != null) { if (entry.hash == hash && entry.key.equals(key)) { if (previousEntry != null) { previousEntry.next = entry.next; } else { myTable[index] = entry.next; } myEntryCount--; myModCount++; return entry.getValue(); } previousEntry = entry; entry = entry.next; } return null; }
public boolean containsKey(Object key) { if (isEmpty()) { return false; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (entry.hash == hash && eq(key, entry.key)) { return true; } entry = entry.next; } return false; }
public Object remove(Object key) { if (isEmpty()) { return null; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; TableEntry previousEntry = null; while (entry != null) { if (entry.hash == hash && entry.key.equals(key)) { if (previousEntry != null) { previousEntry.next = entry.next; } else { myTable[index] = entry.next; } myEntryCount--; myModCount++; return entry.getValue(); } previousEntry = entry; entry = entry.next; } return null; }
public boolean containsKey(Object key) { if (isEmpty()) { return false; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (entry.hash == hash && eq(key, entry.key)) { return true; } entry = entry.next; } return false; }
public Object put(Object key, Object value) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash);
public Object put(Object key, Object value) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash);
public Object put(Object key, Object value) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash);