org.xmloperator.lambda.tree.util
Class FactoryUtils

java.lang.Object
  |
  +--org.xmloperator.lambda.tree.util.FactoryUtils

public abstract class FactoryUtils
extends java.lang.Object

Utilities about building Expressions and returning them to their factory.


Constructor Summary
FactoryUtils()
           
 
Method Summary
static Abstraction newAbstraction(Term body)
          Creates and returns a new Abstraction.
static Application newApplication(Term body, Term argument)
          Creates and returns a new Application.
static EndOfScope newEndOfScope(Term body)
          Creates and returns a new EndOfScope.
static Term newLeaf(TermFactory termFactory, int endOfScopeCount)
          Creates and returns a Leaf contained in a sequence of EndOfScopes.
static void returnTerm(Term rootTerm)
          Return a Term and its content to the factory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryUtils

public FactoryUtils()
Method Detail

newLeaf

public static final Term newLeaf(TermFactory termFactory,
                                 int endOfScopeCount)
Creates and returns a Leaf contained in a sequence of EndOfScopes.

Parameters:
termFactory - a TermFactory.
endOfScopeCount - a count of EndOfScope(s).
Returns:
the created Leaf.

newEndOfScope

public static final EndOfScope newEndOfScope(Term body)
Creates and returns a new EndOfScope.

Parameters:
body - a body for the EndOfSCope.
Returns:
the created EndOfScope.
Throws:
java.lang.NullPointerException - if the given body is null.

newAbstraction

public static final Abstraction newAbstraction(Term body)
Creates and returns a new Abstraction.

Parameters:
body - a body for the Abstraction.
Returns:
the created Abstraction.
Throws:
java.lang.NullPointerException - if the given body is null.

newApplication

public static final Application newApplication(Term body,
                                               Term argument)
Creates and returns a new Application.

Parameters:
body - its body.
argument - its argument.
Returns:
the created Application.
Throws:
java.lang.NullPointerException - if the given body is null.

returnTerm

public static final void returnTerm(Term rootTerm)
Return a Term and its content to the factory.

Parameters:
rootTerm - a no more used Term.
Throws:
java.lang.NullPointerException - if the given Term is broken.