Class AbstractPNode
java.lang.Object
com.singularsys.extensions.polynomials.AbstractPNode
- All Implemented Interfaces:
PNodeI,Serializable,Comparable<PNodeI>
Default methods, when more specific methods do not work.
- Author:
- Rich Morris Created on 22-Dec-2004
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PolynomialCreatorA reference to the PolynomialCreator instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the sum of this node and argumentintCompares this expression to argument.Divides this by the argument.booleanbooleanequalsPNode(PNodeI node) True is nodes represent the same parse treesinvert()inverts node i.e. 1/xbooleanisOne()True if node represents onebooleanisZero()True if node represents zeroMultiplies this by the argument.Raise this to the argument.Returns the difference between this node and argumentMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.singularsys.extensions.polynomials.PNodeI
convertToPolyArray, expand, negate, substitute, toCompactNode, toNode, toString, toString
-
Field Details
-
pc
A reference to the PolynomialCreator instance.
-
-
Constructor Details
-
AbstractPNode
-
-
Method Details
-
add
Returns the sum of this node and argument- Specified by:
addin interfacePNodeI- Parameters:
node- to add- Returns:
- node representing the sum
- Throws:
ParseException- on error
-
sub
Returns the difference between this node and argument- Specified by:
subin interfacePNodeI- Parameters:
node- to subtract- Returns:
- node representing the difference
- Throws:
ParseException- on error
-
mul
Description copied from interface:PNodeIMultiplies this by the argument.- Specified by:
mulin interfacePNodeI- Throws:
ParseException
-
div
Description copied from interface:PNodeIDivides this by the argument.- Specified by:
divin interfacePNodeI- Throws:
ParseException
-
invert
Description copied from interface:PNodeIinverts node i.e. 1/x- Specified by:
invertin interfacePNodeI- Throws:
ParseException
-
pow
Description copied from interface:PNodeIRaise this to the argument.- Specified by:
powin interfacePNodeI- Throws:
ParseException
-
equals
-
equalsPNode
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 -
compareTo
Description copied from interface:PNodeICompares this expression to argument. Uses a total ordering of expressions. Returns positive if this node comes after the argument.- Specified by:
compareToin interfaceComparable<PNodeI>- Specified by:
compareToin interfacePNodeI
-