public Entry getOrPutEntry(Entry element) { Object key = element.key; int h = element.hash; final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); ComplexKeyHashMap.Entry e = t[index]; for (; e != null; e = e.next) if (e.hash == h && ((Entry) e).key.equals(key)) return (Entry) e; Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = key; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
private void makeStaticPropertyIndex() { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); for (ComplexKeyHashMap.EntryIterator iter = propertyMap.getEntrySetIterator(); iter.hasNext();) { SingleKeyHashMap.Entry entry = ((SingleKeyHashMap.Entry) iter.next()); MetaProperty mp = (MetaProperty) entry.getValue(); if (mp instanceof CachedField) { CachedField mfp = (CachedField) mp; if (!mfp.isStatic()) continue; } else if (mp instanceof MetaBeanProperty) { MetaProperty result = establishStaticMetaProperty(mp); if (result == null) continue; else { mp = result; } } else { continue; // ignore all other types } staticPropertyIndex.put(entry.getKey(), mp); } }
private void makeStaticPropertyIndex() { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); for (ComplexKeyHashMap.EntryIterator iter = propertyMap.getEntrySetIterator(); iter.hasNext();) { SingleKeyHashMap.Entry entry = ((SingleKeyHashMap.Entry) iter.next()); MetaProperty mp = (MetaProperty) entry.getValue(); if (mp instanceof CachedField) { CachedField mfp = (CachedField) mp; if (!mfp.isStatic()) continue; } else if (mp instanceof MetaBeanProperty) { MetaProperty result = establishStaticMetaProperty(mp); if (result == null) continue; else { mp = result; } } else { continue; // ignore all other types } staticPropertyIndex.put(entry.getKey(), mp); } }
public static SingleKeyHashMap copy (SingleKeyHashMap dst, SingleKeyHashMap src, Copier copier) { dst.threshold = src.threshold; dst.size = src.size; final int len = src.table.length; final ComplexKeyHashMap.Entry[] t = new ComplexKeyHashMap.Entry[len], tt = src.table; for (int i = 0; i != len; ++i) { for (Entry e = (Entry) tt[i]; e != null; e = (Entry) e.next) { Entry ee = new Entry(); ee.hash = e.hash; ee.key = e.key; ee.value = copier.copy(e.value); ee.next = t [i]; t [i] = ee; } } dst.table = t; return dst; }
public Entry getOrPutEntry(Entry element) { Object key = element.key; int h = element.hash; final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); ComplexKeyHashMap.Entry e = t[index]; for (; e != null; e = e.next) if (e.hash == h && ((Entry) e).key.equals(key)) return (Entry) e; Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = key; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public static SingleKeyHashMap copy (SingleKeyHashMap dst, SingleKeyHashMap src, Copier copier) { dst.threshold = src.threshold; dst.size = src.size; final int len = src.table.length; final ComplexKeyHashMap.Entry[] t = new ComplexKeyHashMap.Entry[len], tt = src.table; for (int i = 0; i != len; ++i) { for (Entry e = (Entry) tt[i]; e != null; e = (Entry) e.next) { Entry ee = new Entry(); ee.hash = e.hash; ee.key = e.key; ee.value = copier.copy(e.value); ee.next = t [i]; t [i] = ee; } } dst.table = t; return dst; }
public Entry getOrPut(Object key) { int h = hash (key.hashCode()); final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); ComplexKeyHashMap.Entry e = t[index]; for (; e != null; e = e.next) if (e.hash == h && ((Entry) e).key.equals(key)) return (Entry) e; Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = key; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public Entry getOrPut(Object key) { int h = hash (key.hashCode()); final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); ComplexKeyHashMap.Entry e = t[index]; for (; e != null; e = e.next) if (e.hash == h && ((Entry) e).key.equals(key)) return (Entry) e; Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = key; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public Entry getOrPutEntry(Entry element) { Object key = element.key; int h = element.hash; final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); ComplexKeyHashMap.Entry e = t[index]; for (; e != null; e = e.next) if (e.hash == h && ((Entry) e).key.equals(key)) return (Entry) e; Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = key; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public static SingleKeyHashMap copy (SingleKeyHashMap dst, SingleKeyHashMap src, Copier copier) { dst.threshold = src.threshold; dst.size = src.size; final int len = src.table.length; final ComplexKeyHashMap.Entry[] t = new ComplexKeyHashMap.Entry[len], tt = src.table; for (int i = 0; i != len; ++i) { for (Entry e = (Entry) tt[i]; e != null; e = (Entry) e.next) { Entry ee = new Entry(); ee.hash = e.hash; ee.key = e.key; ee.value = copier.copy(e.value); ee.next = t [i]; t [i] = ee; } } dst.table = t; return dst; }
private void makeStaticPropertyIndex() { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); for (ComplexKeyHashMap.EntryIterator iter = propertyMap.getEntrySetIterator(); iter.hasNext();) { SingleKeyHashMap.Entry entry = ((SingleKeyHashMap.Entry) iter.next()); MetaProperty mp = (MetaProperty) entry.getValue(); if (mp instanceof CachedField) { CachedField mfp = (CachedField) mp; if (!mfp.isStatic()) continue; } else if (mp instanceof MetaBeanProperty) { MetaProperty result = establishStaticMetaProperty(mp); if (result == null) continue; else { mp = result; } } else { continue; // ignore all other types } staticPropertyIndex.put(entry.getKey(), mp); } }
public Entry getOrPutEntry(Entry element) { Object key = element.key; int h = element.hash; final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); ComplexKeyHashMap.Entry e = t[index]; for (; e != null; e = e.next) if (e.hash == h && ((Entry) e).key.equals(key)) return (Entry) e; Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = key; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public Entry getOrPut(Object key) { int h = hash (key.hashCode()); final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); ComplexKeyHashMap.Entry e = t[index]; for (; e != null; e = e.next) if (e.hash == h && ((Entry) e).key.equals(key)) return (Entry) e; Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = key; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public Entry putCopyOfUnexisting(Entry ee) { int h = ee.hash; final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = ee.key; entry.value = ee.value; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public void iterate() { final ComplexKeyHashMap.Entry[] table = metaMethodIndex.methodHeaders.getTable(); int len = table.length; for (int i = 0; i != len; ++i) { for (SingleKeyHashMap.Entry classEntry = (SingleKeyHashMap.Entry) table[i]; classEntry != null; classEntry = (SingleKeyHashMap.Entry) classEntry.next) { Class clazz = (Class) classEntry.getKey(); if (skipClass(clazz)) continue; MetaMethodIndex.Header header = (MetaMethodIndex.Header) classEntry.getValue(); for (MetaMethodIndex.Entry nameEntry = header.head; nameEntry != null; nameEntry = nameEntry.nextClassEntry) { methodNameAction(clazz, nameEntry); } } } }
public void iterate() { final ComplexKeyHashMap.Entry[] table = metaMethodIndex.methodHeaders.getTable(); int len = table.length; for (int i = 0; i != len; ++i) { for (SingleKeyHashMap.Entry classEntry = (SingleKeyHashMap.Entry) table[i]; classEntry != null; classEntry = (SingleKeyHashMap.Entry) classEntry.next) { Class clazz = (Class) classEntry.getKey(); if (skipClass(clazz)) continue; MetaMethodIndex.Header header = (MetaMethodIndex.Header) classEntry.getValue(); for (MetaMethodIndex.Entry nameEntry = header.head; nameEntry != null; nameEntry = nameEntry.nextClassEntry) { methodNameAction(clazz, nameEntry); } } } }
public Entry putCopyOfUnexisting(Entry ee) { int h = ee.hash; final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = ee.key; entry.value = ee.value; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public Entry putCopyOfUnexisting(Entry ee) { int h = ee.hash; final ComplexKeyHashMap.Entry[] t = table; final int index = h & (t.length - 1); Entry entry = new Entry(); entry.next = t [index]; entry.hash = h; entry.key = ee.key; entry.value = ee.value; t[index] = entry; if ( ++size == threshold ) resize(2* t.length); return entry; }
public void iterate() { final ComplexKeyHashMap.Entry[] table = metaMethodIndex.methodHeaders.getTable(); int len = table.length; for (int i = 0; i != len; ++i) { for (SingleKeyHashMap.Entry classEntry = (SingleKeyHashMap.Entry) table[i]; classEntry != null; classEntry = (SingleKeyHashMap.Entry) classEntry.next) { Class clazz = (Class) classEntry.getKey(); if (skipClass(clazz)) continue; MetaMethodIndex.Header header = (MetaMethodIndex.Header) classEntry.getValue(); for (MetaMethodIndex.Entry nameEntry = header.head; nameEntry != null; nameEntry = nameEntry.nextClassEntry) { methodNameAction(clazz, nameEntry); } } } }
private void copyNonPrivateFields(SingleKeyHashMap from, SingleKeyHashMap to) { for (ComplexKeyHashMap.EntryIterator iter = from.getEntrySetIterator(); iter.hasNext();) { SingleKeyHashMap.Entry entry = (SingleKeyHashMap.Entry) iter.next(); CachedField mfp = (CachedField) entry.getValue(); if (!Modifier.isPublic(mfp.getModifiers()) && !Modifier.isProtected(mfp.getModifiers())) continue; to.put(entry.getKey(), mfp); } }