Class DifferentiableManager

java.lang.Object
math.differentialcalculus.DifferentiableManager

public class DifferentiableManager extends Object
  • Field Details

    • DIFFERENTIABLES

      private final ArrayList<Differentiable> DIFFERENTIABLES
      Records all differentiables used by the function to be differentiated.
  • Constructor Details

    • DifferentiableManager

      public DifferentiableManager()
  • Method Details

    • getDIFFERENTIABLES

      public ArrayList<Differentiable> getDIFFERENTIABLES()
    • count

      public int count()
      Returns:
      The number of Differentiable objects stored by an object of this class.
    • contains

      public boolean contains(String name)
      Parameters:
      name - The name of the Differentiable.
      Returns:
      true if a Differentiable exists by the name supplied.
    • indexOf

      public int indexOf(String name)
      Parameters:
      name - The name of the dependent variable of the Differentiable.
      Returns:
      the index of the Differentiable object that has the name supplied. If no such Differentiable object exists, then it returns -1.
    • getDifferentiable

      public Differentiable getDifferentiable(String name) throws ClassNotFoundException
      Parameters:
      name - The name of the Differentiable.
      Returns:
      the Differentiable object that has the name supplied if it exists. If no such Differentiable object exists, then it returns null.
      Throws:
      ClassNotFoundException - if no Differentiable object by that name exists.
    • getDifferentiable

      public Differentiable getDifferentiable(int index) throws ClassNotFoundException
      Parameters:
      index - The index of the Differentiable in this DifferentiableManager object. If no such index exists, then it returns null.
      Throws:
      ClassNotFoundException - if no Differentiable object by that name exists.
    • lookUp

      public Differentiable lookUp(String name)
      Attempts to retrieve a Differentiable object from a DifferentiableManager based on its name.
      Parameters:
      name - The name of the Differentiable object.
      Returns:
      the Differentiable object that has that name or null if the Differentiable is not found.
    • add

      public void add(Differentiable diff)
      Parameters:
      diff - The Differentiable object to add to this object.
    • delete

      public void delete(String name)
      Removes a Differentiable object from this DifferentiableManager.
    • firstDifferentiable

      public Differentiable firstDifferentiable()
    • lastDifferentiable

      public Differentiable lastDifferentiable()
    • update

      public int update(String name, String newName)
      It updates the name of a Differentiable object in this DifferentiableManager with the parameter newName.
      Parameters:
      name - The name of the Differentiable in this DifferentiableManager that we wish to update.
      newName - The new name to give the Differentiable.
      Returns:
      The index of the object, if a Differentiable by that name is already recorded in the DifferentiableManager and -1 the Differentiable is not found.
    • update

      public int update(String name, ArrayList<String> data)
      Updates a Differentiable object in this DifferentiableManager.
      Parameters:
      name - The name of the Differentiable object to be updated.
      data - The data to be used to update the object if found.
      Returns:
      The index of the object, if a Differentiable by that name is already recorded in the DifferentiableManager and -1 the Differentiable is not found.
    • clearAll

      public void clearAll()