Package it.unimi.di.prog2.h19
Class AbstractPoly
java.lang.Object
it.unimi.di.prog2.h19.AbstractPoly
- Direct Known Subclasses:
DensePoly
,SparsePoly
A partial implementation of a
Poly
.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractPoly
(int degree) Initializes this to be the a polynomial with given degree. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
degree
private final int degreeThe degree of the polinomial.
-
-
Constructor Details
-
AbstractPoly
protected AbstractPoly(int degree) Initializes this to be the a polynomial with given degree.- Parameters:
degree
- the degree.- Throws:
IllegalArgumentException
- ifn
is not positive.
-
-
Method Details
-
degree
public int degree()Description copied from interface:Poly
Returns the degree of this polynomial. -
equals
-
hashCode
public int hashCode() -
toString
-