org.xmloperator.lambda2.net.impl
Class TermReducerImpl

java.lang.Object
  extended byorg.xmloperator.lambda2.net.impl.TermReducerImpl
All Implemented Interfaces:
TermReducer

public final class TermReducerImpl
extends java.lang.Object
implements TermReducer

TermReducer implementation.


Constructor Summary
TermReducerImpl(int maxStepCount, int[] interactionStat)
          Constructor of TermReducer.
 
Method Summary
 boolean booleanValue(Term booleanTerm)
          Returns the boolean value of the given Term, if it represents a boolean.
 Term normalForm(Term term)
          Returns the normal form, if it exists, of the given Term.
 long numeralValue(Term numeralTerm)
          Returns the Church numeral value represented by the given Term if it represents one, elsewhere returns -1L.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermReducerImpl

public TermReducerImpl(int maxStepCount,
                       int[] interactionStat)
Constructor of TermReducer.

Parameters:
interactionStat - an array of interaction type count. May be null.
Method Detail

normalForm

public Term normalForm(Term term)
                throws TooMuchReductionStepException
Description copied from interface: TermReducer
Returns the normal form, if it exists, of the given Term.

Specified by:
normalForm in interface TermReducer
Parameters:
term - a Term.
Returns:
the given Term in normal form, if it exists.
Throws:
TooMuchReductionStepException - if the given step max count is not enough.

booleanValue

public boolean booleanValue(Term booleanTerm)
Description copied from interface: TermReducer
Returns the boolean value of the given Term, if it represents a boolean.

Specified by:
booleanValue in interface TermReducer
Returns:
the boolean value of the given Term, if it represents a boolean.

numeralValue

public long numeralValue(Term numeralTerm)
Description copied from interface: TermReducer
Returns the Church numeral value represented by the given Term if it represents one, elsewhere returns -1L.

Specified by:
numeralValue in interface TermReducer
Returns:
the Church numeral value represented by the given Term if it represents one, elsewhere returns -1L.