ua.gradsoft.termware.util
Class RuleTransformer

java.lang.Object
  extended by ua.gradsoft.termware.util.AbstractRuleTransformer
      extended by ua.gradsoft.termware.util.RuleTransformer
All Implemented Interfaces:
ITermTransformer

public class RuleTransformer
extends AbstractRuleTransformer

x->y


Constructor Summary
RuleTransformer(Term rule)
          create rule transformer with term t
 
Method Summary
 String getDescription()
          return human-readable description of transformer
 Term getInPattern()
          get input pattern
 String getName()
          return name of transformer.
 Term getOutPattern()
          get output pattern
 String getSource()
          return source-code of this term, if one is aviable.
 Term getTerm()
          return representation of this rule as term
 void setDescription(String description)
           
 void setName(String name)
           
 Term transform(Term t, TermSystem system, TransformationContext ctx)
          attempt to transform term t .
 
Methods inherited from class ua.gradsoft.termware.util.AbstractRuleTransformer
isActionPattern, isLetPattern, isWherePattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleTransformer

public RuleTransformer(Term rule)
                throws TermWareException
create rule transformer with term t

Throws:
TermWareException
Method Detail

transform

public Term transform(Term t,
                      TermSystem system,
                      TransformationContext ctx)
               throws TermWareException
Description copied from interface: ITermTransformer
attempt to transform term t .

Specified by:
transform in interface ITermTransformer
Specified by:
transform in class AbstractRuleTransformer
Parameters:
t - - term to transform
system - - system which give us access to ebvironment.
ctx - - context of transformation.
Returns:
- transformed term.
Throws:
TermWareException

getInPattern

public final Term getInPattern()
Description copied from class: AbstractRuleTransformer
get input pattern

Specified by:
getInPattern in class AbstractRuleTransformer

getOutPattern

public final Term getOutPattern()
Description copied from class: AbstractRuleTransformer
get output pattern

Specified by:
getOutPattern in class AbstractRuleTransformer

getDescription

public String getDescription()
Description copied from interface: ITermTransformer
return human-readable description of transformer


getName

public String getName()
Description copied from interface: ITermTransformer
return name of transformer. (usually is a name of top-level reduced term). this name is not used internally by termware engine, but can be printed in system description for human.

Returns:
name of transformer.

setDescription

public void setDescription(String description)

setName

public void setName(String name)

getSource

public String getSource()
Description copied from interface: ITermTransformer
return source-code of this term, if one is aviable.


getTerm

public Term getTerm()
             throws TermWareException
Description copied from class: AbstractRuleTransformer
return representation of this rule as term

Specified by:
getTerm in class AbstractRuleTransformer
Throws:
TermWareException