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 PolynomialCreatorpcA 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 PNodeIadd(PNodeI node)Adds a node to this one.intcompareTo(PNodeI node)Compares this expression to argument.PNodeIdiv(PNodeI node)Divides this by the argument.booleanequals(java.lang.Object arg)True is nodes represent the same parse treesbooleanequalsPNode(PNodeI node)True is nodes represent the same parse treesPNodeIinvert()inverts node i.e. 1/xbooleanisOne()True if node represents onebooleanisZero()True if node represents zeroPNodeImul(PNodeI node)Multiplies this by the argument.PNodeIpow(PNodeI node)Raise this to the argument.PNodeIsub(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:PNodeIAdds a node to this one.- Specified by:
addin interfacePNodeI- Throws:
ParseException
-
sub
public PNodeI sub(PNodeI node) throws ParseException
Description copied from interface:PNodeISubtracts the argument from this.- Specified by:
subin interfacePNodeI- Throws:
ParseException
-
mul
public PNodeI mul(PNodeI node) throws ParseException
Description copied from interface:PNodeIMultiplies this by the argument.- Specified by:
mulin interfacePNodeI- Throws:
ParseException
-
div
public PNodeI div(PNodeI node) throws ParseException
Description copied from interface:PNodeIDivides this by the argument.- Specified by:
divin interfacePNodeI- Throws:
ParseException
-
invert
public PNodeI invert() throws ParseException
Description copied from interface:PNodeIinverts node i.e. 1/x- Specified by:
invertin interfacePNodeI- Throws:
ParseException
-
pow
public PNodeI pow(PNodeI node) throws ParseException
Description copied from interface:PNodeIRaise this to the argument.- Specified by:
powin interfacePNodeI- Throws:
ParseException
-
equals
public boolean equals(java.lang.Object arg)
Description copied from interface:PNodeITrue is nodes represent the same parse trees
-
equalsPNode
public boolean equalsPNode(PNodeI node)
Description copied from interface:PNodeITrue is nodes represent the same parse trees- Specified by:
equalsPNodein interfacePNodeI
-
isZero
public boolean isZero()
Description copied from interface:PNodeITrue if node represents zero
-
isOne
public boolean isOne()
Description copied from interface:PNodeITrue if node represents one
-
-