ua.gradsoft.termware.strategies
Class TopDownStrategy

java.lang.Object
  extended by ua.gradsoft.termware.AbstractBuildinTransformer
      extended by ua.gradsoft.termware.strategies.AbstractTermRewritingStrategy
          extended by ua.gradsoft.termware.strategies.TopDownStrategy
All Implemented Interfaces:
ITermRewritingStrategy, ITermTransformer

public class TopDownStrategy
extends AbstractTermRewritingStrategy

at first transform top terms, than subterms.


Constructor Summary
TopDownStrategy()
           
 
Method Summary
 String getDescription()
          get description of transformer.
 String getName()
          get name of transformer.
 Term transform(Term t, TermSystem system, TransformationContext ctx)
          main work of strategy is here: transform term t in system by applying transformers in 'Star' via subclass-specific algorithm.
 
Methods inherited from class ua.gradsoft.termware.strategies.AbstractTermRewritingStrategy
getStar, hasOtherwise, internalsAtFirst
 
Methods inherited from class ua.gradsoft.termware.AbstractBuildinTransformer
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ua.gradsoft.termware.ITermTransformer
getSource
 

Constructor Detail

TopDownStrategy

public TopDownStrategy()
Method Detail

transform

public Term transform(Term t,
                      TermSystem system,
                      TransformationContext ctx)
               throws TermWareException
Description copied from class: AbstractTermRewritingStrategy
main work of strategy is here: transform term t in system by applying transformers in 'Star' via subclass-specific algorithm.

Specified by:
transform in interface ITermRewritingStrategy
Specified by:
transform in interface ITermTransformer
Specified by:
transform in class AbstractTermRewritingStrategy
Parameters:
t - - term to transform
system - - system which we use
ctx - - context of transformation
Returns:
- transformed term.
Throws:
TermWareException

getDescription

public String getDescription()
Description copied from class: AbstractBuildinTransformer
get description of transformer. Default behaviour -- return the value of annotation @TransformerDescription binded to this.getClass().

Specified by:
getDescription in interface ITermTransformer
Overrides:
getDescription in class AbstractBuildinTransformer
See Also:
TransformerDescription

getName

public String getName()
Description copied from class: AbstractBuildinTransformer
get name of transformer. Default behaviour -- return the value of annotation @TransformerName binded to this.getClass().

Specified by:
getName in interface ITermTransformer
Overrides:
getName in class AbstractBuildinTransformer
Returns:
name of transformer.
See Also:
TransformerName