Package dk.brics.xmlgraph

Examples of dk.brics.xmlgraph.MultiContentNode


                if (content instanceof ElementNode || content instanceof AttributeNode) {
                    sc.setContent(pred.get(content).getIndex());
                }
            }
            else if (node instanceof MultiContentNode) {
                MultiContentNode mc = (MultiContentNode)node;
                LinkedList<Integer> newcontent = new LinkedList<Integer>();
                LinkedList<Integer> removedcontent = new LinkedList<Integer>();
                for (int child : mc.getContents()) {
                    Node content = xg.getNode(child);
                    if (content instanceof ElementNode || content instanceof AttributeNode) {
                        Node p = pred.get(content);
                        if (p != mc) { // predecessor might be this node -- don't change that
                            newcontent.add(p.getIndex());
                            removedcontent.add(child);
                        }
                    }
                }
                mc.getContents().removeAll(removedcontent);
                mc.getContents().addAll(newcontent);
            }
        }
    }
View Full Code Here


        // NOTE: We make all the choice nodes share the same instance of LinkedHashSet
        // Apart from saving memory, it allows us to update all the nodes' content sets at once
        LinkedHashSet<Integer> cs = new LinkedHashSet<Integer>();
        HashSet<Integer> component = new HashSet<Integer>();
        while (true) {
          MultiContentNode node2 = (MultiContentNode)graph.getNode(v2);
          if (node2 instanceof ChoiceNode) {
            ((ChoiceNode)node2).setContent(cs, graph);
            cs.addAll(node2.getContents());
          }
          component.add(v2);
          if (v2 == v)
            break;
          v2 = stack.pop();
View Full Code Here

TOP

Related Classes of dk.brics.xmlgraph.MultiContentNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.