Examples of StringTree


Examples of org.gedcom4j.model.StringTree

     * @throws IOException
     *             if there is a problem reading the data from the reader
     */
    private static StringTree makeStringTreeFromStream(BufferedInputStream bytes) throws IOException {
        List<String> lines = new GedcomFileReader(bytes).getLines();
        StringTree result = new StringTree();
        result.level = -1;
        try {
            for (int lineNum = 1; lineNum <= lines.size(); lineNum++) {
                String line = lines.get(lineNum - 1);
                line = leftTrim(line); // See issue 57
                LinePieces lp = new LinePieces(line);
                StringTree st = new StringTree();
                st.lineNum = lineNum;
                st.level = lp.level;
                st.id = lp.id;
                st.tag = lp.tag;
                st.value = lp.remainder;
                StringTree addTo = findLast(result, lp.level - 1);
                addTo.children.add(st);
                st.parent = addTo;
            }
        } finally {
            if (bytes != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.