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