1 15 package org.apache.hivemind.impl; 16 17 import java.util.AbstractMap ; 18 import java.util.Map ; 19 import java.util.Set ; 20 21 29 public final class ElementsInnerProxyMap extends AbstractMap 30 { 31 private Map _inner; 32 33 private ConfigurationPointImpl _point; 34 35 private ElementsProxyMap _outer; 36 37 ElementsInnerProxyMap(ConfigurationPointImpl point, ElementsProxyMap outer) 38 { 39 _point = point; 40 _outer = outer; 41 42 _outer.setInner(this); 43 } 44 45 public Set entrySet() 46 { 47 return inner().entrySet(); 48 } 49 50 private synchronized Map inner() 51 { 52 if (_inner == null) 53 { 54 _inner = _point.constructMapElements(); 55 56 _outer.setInner(_inner); 58 } 59 60 return _inner; 61 } 62 63 public boolean equals(Object o) 64 { 65 if (this == o) 66 return true; 67 68 if (o == null) 69 return false; 70 71 return inner().equals(o); 72 } 73 74 public int hashCode() 75 { 76 return inner().hashCode(); 77 } 78 79 public synchronized String toString() 80 { 81 if (_inner != null) 82 return _inner.toString(); 83 84 return "<Element Map Proxy for " + _point.getExtensionPointId() + ">"; 85 } 86 87 } | Popular Tags |