1 19 20 28 29 package org.netbeans.modules.xml.axi.impl; 30 31 import java.util.HashMap ; 32 import org.netbeans.modules.xml.axi.AXIComponent; 33 import org.netbeans.modules.xml.axi.AXIDocument; 34 import org.netbeans.modules.xml.axi.AXIModel; 35 import org.netbeans.modules.xml.schema.model.SchemaComponent; 36 37 42 public final class AXIDocumentImpl extends AXIDocument { 43 44 47 public AXIDocumentImpl(AXIModel model, SchemaComponent schemaComponent) { 48 super(model, schemaComponent); 49 } 50 51 public AXIComponent findChild(SchemaComponent child) { 52 if(!canVisitChildren()) { 54 getChildren(); 55 } 56 return globalChildrenCache.get(child); 57 } 58 59 public void addToCache(AXIComponent child) { 60 globalChildrenCache.put(child.getPeer(), child); 61 } 62 63 public void removeFromCache(AXIComponent child) { 64 globalChildrenCache.remove(child.getPeer()); 65 } 66 67 private HashMap <SchemaComponent, AXIComponent> globalChildrenCache = 68 new HashMap <SchemaComponent, AXIComponent>(); 69 } 70 | Popular Tags |