org.jrdf.graph.global.molecule
Class MoleculeToString

java.lang.Object
  extended by org.jrdf.graph.global.molecule.MoleculeToString
All Implemented Interfaces:
MoleculeHandler

public class MoleculeToString
extends Object
implements MoleculeHandler

Creates a simple string representation of a molecule. This is primarily for debugging or other simple purposes. For serialization MoleculeToText.

Version:
$Id: MoleculeToString.java 2894 2009-01-27 21:25:13Z newmana $
Author:
Andrew Newman

Constructor Summary
MoleculeToString(StringBuilder newBuilder)
           
 
Method Summary
 void handleEmptyMolecules()
          The is called instead of handleStart/End contains molecules when the triple visited does not contain any submolecules.
 void handleEndContainsMolecules(Set<Molecule> newMolecules)
          This is called when the top level triple's submolecules have all been visited.
 void handleStartContainsMolecules(Set<Molecule> newMolecules)
          This is called when the current top level triple contains a set of submolecules.
 void handleTriple(Triple triple)
          A triple in the root set of triples is found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoleculeToString

public MoleculeToString(StringBuilder newBuilder)
Method Detail

handleTriple

public void handleTriple(Triple triple)
Description copied from interface: MoleculeHandler
A triple in the root set of triples is found.

Specified by:
handleTriple in interface MoleculeHandler
Parameters:
triple - the triple found.

handleEmptyMolecules

public void handleEmptyMolecules()
Description copied from interface: MoleculeHandler
The is called instead of handleStart/End contains molecules when the triple visited does not contain any submolecules.

Specified by:
handleEmptyMolecules in interface MoleculeHandler

handleStartContainsMolecules

public void handleStartContainsMolecules(Set<Molecule> newMolecules)
Description copied from interface: MoleculeHandler
This is called when the current top level triple contains a set of submolecules.

Specified by:
handleStartContainsMolecules in interface MoleculeHandler
Parameters:
newMolecules - the submolecules belonging to the top level triple.

handleEndContainsMolecules

public void handleEndContainsMolecules(Set<Molecule> newMolecules)
Description copied from interface: MoleculeHandler
This is called when the top level triple's submolecules have all been visited.

Specified by:
handleEndContainsMolecules in interface MoleculeHandler
Parameters:
newMolecules - the submolecules belonging to the top level triple.