eu.bandm.tscore.base
Class Reducer.MergeSymbols<E extends TypedChoice>

java.lang.Object
  extended by eu.bandm.tscore.tdom.Visitor
      extended by eu.bandm.tscore.base.Reducer.MergeSymbols<E>
Enclosing class:
Reducer

protected class Reducer.MergeSymbols<E extends TypedChoice>
extends eu.bandm.tscore.tdom.Visitor

Creates a new list of elements, where all adjacent idents, numerics and nonAlfanumeric(E/P)s are concatenated in one Element_ident. Other elements are included in this process (constructor param all=true) or preserved in the resulting sequence.


Field Summary
protected  boolean all
           
protected  eu.bandm.tscore.tdom.Element_ident last
           
protected  List<eu.bandm.tscore.tdom.Element> result
           
 
Constructor Summary
Reducer.MergeSymbols(boolean all)
           
 
Method Summary
protected  void flushLast()
           
protected  eu.bandm.tscore.tdom.Element_ident make_Element_ident(String text, Location<XMLDocumentIdentifier> loc)
          Wrap collected text into new, synthetic TDom element.
 List<eu.bandm.tscore.tdom.Element> merge(List<E> elements)
          main function.
protected  void testMerge(String txt, eu.bandm.tscore.tdom.Element el)
           
protected  void testMerge(String txt, Location<XMLDocumentIdentifier> loc)
          Flush "last" to "result" and memoize el als new "last", iff NOT adjacent.
 void visit(eu.bandm.tscore.tdom.Element_application el)
           
 void visit(eu.bandm.tscore.tdom.Element_division el)
           
 void visit(eu.bandm.tscore.tdom.Element_ident el)
           
 void visit(eu.bandm.tscore.tdom.Element_nonAlfanumericP el)
           
 void visit(eu.bandm.tscore.tdom.Element_nonAlfanumericV el)
           
 void visit(eu.bandm.tscore.tdom.Element_numeric el)
           
 void visit(eu.bandm.tscore.tdom.Element_stringconst el)
           
 void visitEl(eu.bandm.tscore.tdom.Element el)
          Always flush "last" to "result" and memoize el als new "last".
 
Methods inherited from class eu.bandm.tscore.tdom.Visitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

protected final List<eu.bandm.tscore.tdom.Element> result

all

protected final boolean all

last

protected eu.bandm.tscore.tdom.Element_ident last
Constructor Detail

Reducer.MergeSymbols

public Reducer.MergeSymbols(boolean all)
Method Detail

merge

public List<eu.bandm.tscore.tdom.Element> merge(List<E> elements)
main function.


flushLast

protected void flushLast()

make_Element_ident

protected eu.bandm.tscore.tdom.Element_ident make_Element_ident(String text,
                                                                Location<XMLDocumentIdentifier> loc)
Wrap collected text into new, synthetic TDom element.


testMerge

protected void testMerge(String txt,
                         Location<XMLDocumentIdentifier> loc)
Flush "last" to "result" and memoize el als new "last", iff NOT adjacent. Otherwise append to "last".


testMerge

protected void testMerge(String txt,
                         eu.bandm.tscore.tdom.Element el)

visit

public void visit(eu.bandm.tscore.tdom.Element_ident el)
Overrides:
visit in class eu.bandm.tscore.tdom.Visitor

visit

public void visit(eu.bandm.tscore.tdom.Element_nonAlfanumericV el)
Overrides:
visit in class eu.bandm.tscore.tdom.Visitor

visit

public void visit(eu.bandm.tscore.tdom.Element_nonAlfanumericP el)
Overrides:
visit in class eu.bandm.tscore.tdom.Visitor

visit

public void visit(eu.bandm.tscore.tdom.Element_numeric el)
Overrides:
visit in class eu.bandm.tscore.tdom.Visitor

visitEl

public void visitEl(eu.bandm.tscore.tdom.Element el)
Always flush "last" to "result" and memoize el als new "last".


visit

public void visit(eu.bandm.tscore.tdom.Element_stringconst el)
Overrides:
visit in class eu.bandm.tscore.tdom.Visitor

visit

public void visit(eu.bandm.tscore.tdom.Element_division el)
Overrides:
visit in class eu.bandm.tscore.tdom.Visitor

visit

public void visit(eu.bandm.tscore.tdom.Element_application el)
Overrides:
visit in class eu.bandm.tscore.tdom.Visitor