public static <B> BeanPropertyAccessor<B> forClass(Class<B> clazz, PropertySet set) { synchronized (cAccessors) { Map<Class, SoftReference<BeanPropertyAccessor>> accessors = cAccessors.get(set); if (accessors == null) { accessors = new WeakIdentityMap<Class, SoftReference<BeanPropertyAccessor>>(); cAccessors.put(set, accessors); } BeanPropertyAccessor bpa; SoftReference<BeanPropertyAccessor> ref = accessors.get(clazz); if (ref != null) { bpa = ref.get(); if (bpa != null) { return bpa; } } bpa = generate(clazz, set); accessors.put(clazz, new SoftReference<BeanPropertyAccessor>(bpa)); return bpa; } }
public int size() { // Cleanup right before, to report a more accurate size. cleanup(); return this.count; }
public void clear() { WeakIdentityMap.this.clear(); } public String toString() {
/** * Gets the map as a String. * * @return a string version of the map */ public String toString() { return toString(this); }
public void putAll(Map<? extends K, ? extends V> t) { Iterator i = t.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry) i.next(); put((K) e.getKey(), (V) e.getValue()); } }
public boolean contains(Object o) { return containsKey(o); } public boolean remove(Object o) {
public boolean contains(Object o) { return containsValue(o); } public void clear() {
public WeakIdentityMap(Map<? extends K, ? extends V> t) { this(Math.max(2 * t.size(), 11), 0.75f); putAll(t); }
public boolean remove(Object o) { return o == null ? false : WeakIdentityMap.this.remove(o) == o; } public void clear() {
public String toString() { return WeakIdentityMap.this.toString(this); } };
public void putAll(Map<? extends K, ? extends V> t) { Iterator i = t.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry) i.next(); put((K) e.getKey(), (V) e.getValue()); } }
public boolean contains(Object o) { return containsKey(o); } public boolean remove(Object o) {
public boolean contains(Object o) { return containsValue(o); } public void clear() {
public WeakIdentityMap(Map<? extends K, ? extends V> t) { this(Math.max(2 * t.size(), 11), 0.75f); putAll(t); }
public boolean remove(Object o) { return o == null ? false : WeakIdentityMap.this.remove(o) == o; } public void clear() {
public TransactionManager(TransactionMonitor monitor) { mLocalScope = new ThreadLocal<TransactionScope<Txn>>(); mAllScopes = new WeakIdentityMap(); mMonitor = monitor; }
public String toString() { return WeakIdentityMap.toString(this); } };
public void clear() { WeakIdentityMap.this.clear(); } public String toString() {