org.activemath.omdocjdom.rephrase
Class RephraseGraph

java.lang.Object
  extended by org.activemath.omdocjdom.rephrase.RephraseGraph
All Implemented Interfaces:
Serializable

public class RephraseGraph
extends Object
implements Serializable

Describes the possible cd-groups (vertices of the graph) and transitions between them (edges of the graph).

See Also:
Serialized Form

Constructor Summary
RephraseGraph()
           
 
Method Summary
 void dump(Writer out)
           
 List findAllCompatibleNodes(OJElement omobj)
          Searches through the nodes for content-dictionary content-types that can contain all the symbols of the passwed OMOBJ.
 List findPath(OJElement sourceOM, Iterator targetEncodings)
          Walks through the possible target-CD-groups and finds the first applicable translation-path.
 void init(MBaseRef mbase, Subconfiguration config)
          Fills the graph with the rephrase-rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RephraseGraph

public RephraseGraph()
Method Detail

findPath

public List findPath(OJElement sourceOM,
                     Iterator targetEncodings)
Walks through the possible target-CD-groups and finds the first applicable translation-path.

Parameters:
sourceOM -
targetEncodings - iterates over ContentType objects
Returns:
a list of Edges.

init

public void init(MBaseRef mbase,
                 Subconfiguration config)
          throws org.jdom.JDOMException,
                 MBaseException
Fills the graph with the rephrase-rules. First builds a node for the "all CDs" (of this installation), then builds nodes for each presentation target with an edge from all. Then take configured CD-groups not forgetting "trivial" inclusion edges. THINKME: map a symbol to a variable with a sensible name is actually quite common r ?

Throws:
org.jdom.JDOMException
MBaseException

findAllCompatibleNodes

public List findAllCompatibleNodes(OJElement omobj)
Searches through the nodes for content-dictionary content-types that can contain all the symbols of the passwed OMOBJ. Note that this method needs all OMS to contain an xref attribute. Use OMSDisambiguator in case.

Parameters:
omobj -
Returns:
the compatible CD-Nodes, in preferability order

dump

public void dump(Writer out)
          throws IOException
Throws:
IOException