/** * Iterate all descendant model groups of the given model group, including itself. */ private Iterator<XSComponent> descendants(XSModelGroup mg) { // TODO: write a tree iterator // for now, we do it eagerly because I'm lazy List<XSComponent> r = new ArrayList<XSComponent>(); visit(mg,r); return r.iterator(); }
public Iterator<XSComponent> particle(XSParticle particle) { return descendants(particle.getTerm().asModelGroup()); }
public Iterator<XSComponent> particle(XSParticle particle) { return descendants(particle.getTerm().asModelGroup()); }
public Iterator<XSComponent> particle(XSParticle particle) { return descendants(particle.getTerm().asModelGroup()); }
public Iterator<XSComponent> modelGroupDecl(XSModelGroupDecl decl) { return descendants(decl.getModelGroup()); }
public Iterator<XSComponent> modelGroupDecl(XSModelGroupDecl decl) { return descendants(decl.getModelGroup()); }
public Iterator<XSComponent> modelGroupDecl(XSModelGroupDecl decl) { return descendants(decl.getModelGroup()); }
public Iterator<XSComponent> modelGroupDecl(XSModelGroupDecl decl) { return descendants(decl.getModelGroup()); }
private void visit(XSModelGroup mg, List<XSComponent> r) { // since model groups never form a cycle, no cycle check is needed r.add(mg); for (XSParticle p : mg) { XSModelGroup child = p.getTerm().asModelGroup(); if(child!=null) visit(child,r); } }
/** * Iterate all descendant model groups of the given model group, including itself. */ private Iterator<XSComponent> descendants(XSModelGroup mg) { // TODO: write a tree iterator // for now, we do it eagerly because I'm lazy List<XSComponent> r = new ArrayList<XSComponent>(); visit(mg,r); return r.iterator(); }
private void visit(XSModelGroup mg, List<XSComponent> r) { // since model groups never form a cycle, no cycle check is needed r.add(mg); for (XSParticle p : mg) { XSModelGroup child = p.getTerm().asModelGroup(); if(child!=null) visit(child,r); } }
/** * Iterate all descendant model groups of the given model group, including itself. */ private Iterator<XSComponent> descendants(XSModelGroup mg) { // TODO: write a tree iterator // for now, we do it eagerly because I'm lazy List<XSComponent> r = new ArrayList<XSComponent>(); visit(mg,r); return r.iterator(); }
public Iterator<XSComponent> elementDecl(XSElementDecl decl) { XSComplexType ct = decl.getType().asComplexType(); if(ct==null) return empty(); else { // also pick up model groups inside this complex type return new Iterators.Union<XSComponent>(singleton(ct),complexType(ct)); } }
public Iterator<XSComponent> modelGroupDecl(XSModelGroupDecl decl) { return descendants(decl.getModelGroup()); }
private void visit(XSModelGroup mg, List<XSComponent> r) { // since model groups never form a cycle, no cycle check is needed r.add(mg); for (XSParticle p : mg) { XSModelGroup child = p.getTerm().asModelGroup(); if(child!=null) visit(child,r); } }
/** * Iterate all descendant model groups of the given model group, including itself. */ private Iterator<XSComponent> descendants(XSModelGroup mg) { // TODO: write a tree iterator // for now, we do it eagerly because I'm lazy List<XSComponent> r = new ArrayList<XSComponent>(); visit(mg,r); return r.iterator(); }
public Iterator<XSComponent> elementDecl(XSElementDecl decl) { XSComplexType ct = decl.getType().asComplexType(); if(ct==null) return empty(); else { // also pick up model groups inside this complex type return new Iterators.Union<XSComponent>(singleton(ct),complexType(ct)); } }
/** * Iterate all descendant model groups of the given model group, including itself. */ private Iterator<XSComponent> descendants(XSModelGroup mg) { // TODO: write a tree iterator // for now, we do it eagerly because I'm lazy List<XSComponent> r = new ArrayList<XSComponent>(); visit(mg,r); return r.iterator(); }
private void visit(XSModelGroup mg, List<XSComponent> r) { // since model groups never form a cycle, no cycle check is needed r.add(mg); for (XSParticle p : mg) { XSModelGroup child = p.getTerm().asModelGroup(); if(child!=null) visit(child,r); } }
public Iterator<XSComponent> particle(XSParticle particle) { return descendants(particle.getTerm().asModelGroup()); }