|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lsmp.djep.sjep.AbstractPNode
org.lsmp.djep.sjep.Polynomial
public class Polynomial
Represents a polynomial.
i.e. a sum of terms which are typically
Monomials, but can be any AbstractPNode. The order of the terms is specified by the total ordering.
| Field Summary |
|---|
| Fields inherited from class org.lsmp.djep.sjep.AbstractPNode |
|---|
pc |
| Method Summary | |
|---|---|
PNodeI |
add(PNodeI node)
Adds a node to this one. |
PNodeI |
add(Polynomial p)
|
int |
compareTo(PNodeI node)
this < arg ---> -1 this > arg ---> 1 |
int |
compareTo(Polynomial p)
|
PNodeI |
div(PNodeI node)
Divides this by the argument. |
boolean |
equals(PNodeI node)
True is nodes represent the same parse trees |
PNodeI |
expand()
complete expansion. (1+x)^2 --> 1+2*x+x^2 |
PNodeI |
mul(PNodeI node)
Multiplies this by the argument. |
PNodeI |
negate()
negates node i.e. |
PNodeI |
sub(PNodeI node)
Subtracts the argument from this. |
PNodeI |
sub(Polynomial p)
|
Node |
toNode()
Converts the node to standard JEP format. |
java.lang.String |
toString()
Produces a string representation of the argument. |
| Methods inherited from class org.lsmp.djep.sjep.AbstractPNode |
|---|
invert, isOne, isZero, pow |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.lsmp.djep.sjep.PNodeI |
|---|
equals |
| Method Detail |
|---|
public PNodeI add(PNodeI node)
throws ParseException
PNodeI
add in interface PNodeIadd in class AbstractPNodeParseException
public PNodeI sub(PNodeI node)
throws ParseException
PNodeI
sub in interface PNodeIsub in class AbstractPNodeParseException
public PNodeI add(Polynomial p)
throws ParseException
ParseException
public PNodeI sub(Polynomial p)
throws ParseException
ParseException
public PNodeI negate()
throws ParseException
PNodeI
negate in interface PNodeInegate in class AbstractPNodeParseException
public PNodeI mul(PNodeI node)
throws ParseException
PNodeI
mul in interface PNodeImul in class AbstractPNodeParseException
public PNodeI div(PNodeI node)
throws ParseException
PNodeI
div in interface PNodeIdiv in class AbstractPNodeParseExceptionpublic boolean equals(PNodeI node)
PNodeI
equals in interface PNodeIequals in class AbstractPNodepublic int compareTo(PNodeI node)
compareTo in interface PNodeIcompareTo in class AbstractPNodepublic int compareTo(Polynomial p)
public java.lang.String toString()
PNodeI
toString in interface PNodeItoString in class java.lang.Object
public Node toNode()
throws ParseException
PNodeI
ParseException
public PNodeI expand()
throws ParseException
PNodeI
ParseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||