dk.brics.xmlgraph.converter
Class XMLGraphReducer

java.lang.Object
  extended by dk.brics.xmlgraph.converter.XMLGraphReducer

public class XMLGraphReducer
extends Object

XML graph reducer.

References (including root pointers) to non-gap ChoiceNodes and SequenceNodes with exactly one child are redirected to the child.


Constructor Summary
XMLGraphReducer()
          Constructs a new XML graph reducer.
 
Method Summary
 Node reduce(Node n, XMLGraph xg, int from_index, boolean leave_choices)
          Reduces the given XML graph fragment.
 void reduce(XMLGraph xg)
          Reduces the given XML graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLGraphReducer

public XMLGraphReducer()
Constructs a new XML graph reducer.

Method Detail

reduce

public Node reduce(Node n,
                   XMLGraph xg,
                   int from_index,
                   boolean leave_choices)
Reduces the given XML graph fragment.

Parameters:
n - fragment root
xg - XML graph containing the fragment
from_index - node index where reduction starts
leave_choices - if true, ChoiceNodes are not modified
Returns:
new fragment root

reduce

public void reduce(XMLGraph xg)
Reduces the given XML graph.

Parameters:
xg - XML graph


Copyright © 2005-2010 Anders Møller.