Class Polynomial

java.lang.Object
math.equations.Polynomial
Direct Known Subclasses:
Linear, Quadratic

public abstract class Polynomial
extends java.lang.Object
Abstract class for different types of polynomials to extend.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected double[] EMPTY_ARRAY
    An empty array of doubles to return when there are no solutions.
  • Constructor Summary

    Constructors
    Constructor Description
    Polynomial()  
  • Method Summary

    Modifier and Type Method Description
    abstract double[] solutions()
    Calculates the solutions of the equation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EMPTY_ARRAY

      protected final double[] EMPTY_ARRAY
      An empty array of doubles to return when there are no solutions.
  • Constructor Details

    • Polynomial

      public Polynomial()
  • Method Details

    • solutions

      public abstract double[] solutions()
      Calculates the solutions of the equation.
      Returns:
      An array of doubles containing the solutions, if any.