Package org.jrdf.graph.global.molecule

Examples of org.jrdf.graph.global.molecule.MoleculeTraverser


    }

    public Iterator<Triple> iterator() {
        HashSet<Triple> set = new HashSet<Triple>();
        MoleculeToTripleIterator mtti = new MoleculeToTripleIterator(set);
        MoleculeTraverser tmpTraverser = new MoleculeTraverserImpl();
        tmpTraverser.traverse(this, mtti);
        return set.iterator();
    }
View Full Code Here


        this.moleculeComparator = new MoleculeHeadTripleComparatorImpl(comparator);
        this.handler = new MoleculeGraphHandlerImpl(nodePool, readableIndex, moleculeComparator);
    }

    public void add(Molecule molecule) {
        MoleculeTraverser traverser = new MoleculeTraverserImpl();
        traverser.traverse(molecule, new AddMoleculeToIndex(writableIndex, localizer));
    }
View Full Code Here

    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        MoleculeTraverser traverser = new MoleculeTraverserImpl();
        try {
            ClosableIterator<Molecule> iterator = iterator();
            try {
                MoleculeHandler tmpHandler = new MoleculeToText(builder, localizer.getLocalizer());
                while (iterator.hasNext()) {
                    Molecule molecule = iterator.next();
                    traverser.traverse(molecule, tmpHandler);
                }
                return builder.toString();
            } finally {
                iterator.close();
            }
View Full Code Here

TOP

Related Classes of org.jrdf.graph.global.molecule.MoleculeTraverser

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.