X-Git-Url: http://git.megacz.com/?p=org.ibex.xt.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fxt%2FNode.java;h=b4c6026804e2afa145da24b947ff687f1f476645;hp=04e7ee6845a0697ebb1d96cd861528f6ffecca2b;hb=e8f5044051de70a1cdad65df9c5ed6bff3cd1a08;hpb=3f3b2560f1b42d5417b8622ae66648ec042b1159 diff --git a/src/org/ibex/xt/Node.java b/src/org/ibex/xt/Node.java index 04e7ee6..b4c6026 100644 --- a/src/org/ibex/xt/Node.java +++ b/src/org/ibex/xt/Node.java @@ -17,7 +17,7 @@ public class Node { public int numattrs = 0; public String[] attrs = null; public String uri = null; - private int delta = 0; + private int delta = 0; public Node() { } public Node(Node n) { copyFrom(n); } @@ -109,6 +109,19 @@ public class Node { } } + public static class Join extends Node.Stream { + final Node.Stream s1, s2; + boolean s1Done = false; + public Join(Node.Stream s1, Node.Stream s2) { this.s1=s1; this.s2=s2; } + protected boolean _read(Node n) { + if (!s1Done) return s2._read(n); + boolean ret = s1._read(n); + if (ret) return true; + s1Done = true; + return s2._read(n); + } + } + public static class FromXML extends Node.Stream { private final XML.Stream xml; private XML.Elem parent = null;