org.lsmp.djep.groupJep
Class PolynomialVisitor

java.lang.Object
  extended by org.lsmp.djep.xjep.DoNothingVisitor
      extended by org.lsmp.djep.groupJep.PolynomialVisitor
All Implemented Interfaces:
ParserVisitor

public class PolynomialVisitor
extends DoNothingVisitor

Constructs a polynomial from a JEP equation.

Author:
Rich Morris Created on 05-Oct-2004

Constructor Summary
PolynomialVisitor(JEP j)
           
 
Method Summary
 Polynomial calcPolynomial(Node node, FreeGroup fg)
          calculates a polynomial representing the node.
 java.lang.Object visit(ASTConstant node, java.lang.Object data)
           
 java.lang.Object visit(ASTFunNode node, java.lang.Object data)
           
 java.lang.Object visit(ASTVarNode node, java.lang.Object data)
           
 
Methods inherited from class org.lsmp.djep.xjep.DoNothingVisitor
acceptChildrenAsArray, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolynomialVisitor

public PolynomialVisitor(JEP j)
Method Detail

calcPolynomial

public Polynomial calcPolynomial(Node node,
                                 FreeGroup fg)
                          throws ParseException
calculates a polynomial representing the node.

Parameters:
node - The top node of the expression
fg - The group the polynomial is an element of.
Returns:
the polynomial representing the equation
Throws:
ParseException - if the node cannot be converted to a Polynomial

visit

public java.lang.Object visit(ASTFunNode node,
                              java.lang.Object data)
                       throws ParseException
Specified by:
visit in interface ParserVisitor
Overrides:
visit in class DoNothingVisitor
Throws:
ParseException

visit

public java.lang.Object visit(ASTVarNode node,
                              java.lang.Object data)
                       throws ParseException
Specified by:
visit in interface ParserVisitor
Overrides:
visit in class DoNothingVisitor
Throws:
ParseException

visit

public java.lang.Object visit(ASTConstant node,
                              java.lang.Object data)
                       throws ParseException
Specified by:
visit in interface ParserVisitor
Overrides:
visit in class DoNothingVisitor
Throws:
ParseException


http://www.singularsys.com/jep Copyright © 2007 Singular Systems