Class AbstractPNode
- java.lang.Object
-
- com.singularsys.extensions.polynomials.AbstractPNode
-
public abstract class AbstractPNode extends java.lang.Object implements PNodeI
Default methods, when more specific methods do not work.- Author:
- Rich Morris Created on 22-Dec-2004
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PolynomialCreator
pc
A reference to the PolynomialCreator instance.
-
Constructor Summary
Constructors Constructor Description AbstractPNode(PolynomialCreator pc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PNodeI
add(PNodeI node)
Adds a node to this one.int
compareTo(PNodeI node)
Compares this expression to argument.PNodeI
div(PNodeI node)
Divides this by the argument.boolean
equals(java.lang.Object arg)
True is nodes represent the same parse treesboolean
equalsPNode(PNodeI node)
True is nodes represent the same parse treesPNodeI
invert()
inverts node i.e. 1/xboolean
isOne()
True if node represents oneboolean
isZero()
True if node represents zeroPNodeI
mul(PNodeI node)
Multiplies this by the argument.PNodeI
pow(PNodeI node)
Raise this to the argument.PNodeI
sub(PNodeI node)
Subtracts the argument from this.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.singularsys.extensions.polynomials.PNodeI
convertToPolyArray, expand, negate, toCompactNode, toNode, toString
-
-
-
-
Field Detail
-
pc
protected PolynomialCreator pc
A reference to the PolynomialCreator instance.
-
-
Constructor Detail
-
AbstractPNode
public AbstractPNode(PolynomialCreator pc)
-
-
Method Detail
-
add
public PNodeI add(PNodeI node) throws ParseException
Description copied from interface:PNodeI
Adds a node to this one.- Specified by:
add
in interfacePNodeI
- Throws:
ParseException
-
sub
public PNodeI sub(PNodeI node) throws ParseException
Description copied from interface:PNodeI
Subtracts the argument from this.- Specified by:
sub
in interfacePNodeI
- Throws:
ParseException
-
mul
public PNodeI mul(PNodeI node) throws ParseException
Description copied from interface:PNodeI
Multiplies this by the argument.- Specified by:
mul
in interfacePNodeI
- Throws:
ParseException
-
div
public PNodeI div(PNodeI node) throws ParseException
Description copied from interface:PNodeI
Divides this by the argument.- Specified by:
div
in interfacePNodeI
- Throws:
ParseException
-
invert
public PNodeI invert() throws ParseException
Description copied from interface:PNodeI
inverts node i.e. 1/x- Specified by:
invert
in interfacePNodeI
- Throws:
ParseException
-
pow
public PNodeI pow(PNodeI node) throws ParseException
Description copied from interface:PNodeI
Raise this to the argument.- Specified by:
pow
in interfacePNodeI
- Throws:
ParseException
-
equals
public boolean equals(java.lang.Object arg)
Description copied from interface:PNodeI
True is nodes represent the same parse trees
-
equalsPNode
public boolean equalsPNode(PNodeI node)
Description copied from interface:PNodeI
True is nodes represent the same parse trees- Specified by:
equalsPNode
in interfacePNodeI
-
isZero
public boolean isZero()
Description copied from interface:PNodeI
True if node represents zero
-
isOne
public boolean isOne()
Description copied from interface:PNodeI
True if node represents one
-
-