Opus5
Class PolynomialAsOrderedList

java.lang.Object
  |
  +--Opus5.PolynomialAsOrderedList
All Implemented Interfaces:
Polynomial

public class PolynomialAsOrderedList
extends java.lang.Object
implements Polynomial

A polynomial implemented using an ordered list.

Version:
$Id: PolynomialAsOrderedList.java,v 3.3 1998/07/28 13:57:50 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.
See Also:
OrderedList

Fields inherited from interface Opus5.Polynomial
copyright
 
Constructor Summary
PolynomialAsOrderedList()
          Constructs a PolynomialAsOrderedList.
 
Method Summary
 void add(Term term)
          Adds the specified term to this polynomial.
 void differentiate()
          Differentiates this polynomial.
 Polynomial plus(Polynomial poly)
          Returns the sum of this polynomial and the specified polynomial.
 java.lang.String toString()
          Returns a string representation of this polynomial.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolynomialAsOrderedList

public PolynomialAsOrderedList()
Constructs a PolynomialAsOrderedList. The polynomial initially contains no terms. I.e., it is the zero polynomial.
Method Detail

add

public void add(Term term)
Adds the specified term to this polynomial.
Specified by:
add in interface Polynomial
Parameters:
term - The term to be added to this polynomial.

differentiate

public void differentiate()
Differentiates this polynomial. Implemented using a visitor that differentiates one-by-one all the terms in this polynomial.
Specified by:
differentiate in interface Polynomial

toString

public java.lang.String toString()
Returns a string representation of this polynomial.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this polynomial.

plus

public Polynomial plus(Polynomial poly)
Returns the sum of this polynomial and the specified polynomial. This method is not implemented.
Specified by:
plus in interface Polynomial
Parameters:
poly - The polynomial to be added to this polynomial.
Returns:
the sum of this polynomial and the specified polynomial.
Throws:
MethodNotImplemented - Always.
See Also:
PolynomialAsSortedList.plus(Opus5.Polynomial)