Package math.differentialcalculus
Class DifferentiableManager
java.lang.Object
math.differentialcalculus.DifferentiableManager
public class DifferentiableManager
extends java.lang.Object
- Author:
- GBEMIRO
-
Constructor Summary
Constructors Constructor Description DifferentiableManager() -
Method Summary
Modifier and Type Method Description voidadd(Differentiable diff)voidclearAll()booleancontains(java.lang.String name)intcount()voiddelete(java.lang.String name)Removes a Differentiable object from this DifferentiableManager.DifferentiablefirstDifferentiable()DifferentiablegetDifferentiable(int index)DifferentiablegetDifferentiable(java.lang.String name)java.util.ArrayList<Differentiable>getDIFFERENTIABLES()intindexOf(java.lang.String name)DifferentiablelastDifferentiable()DifferentiablelookUp(java.lang.String name)Attempts to retrieve a Differentiable object from a DifferentiableManager based on its name.intupdate(java.lang.String name, java.lang.String newName)It updates the name of a Differentiable object in this DifferentiableManager with the parameternewName.intupdate(java.lang.String name, java.util.ArrayList<java.lang.String> data)Updates a Differentiable object in this DifferentiableManager.
-
Constructor Details
-
DifferentiableManager
public DifferentiableManager()
-
-
Method Details
-
getDIFFERENTIABLES
-
count
public int count()- Returns:
- The number of Differentiable objects stored by an object of this class.
-
contains
public boolean contains(java.lang.String name)- Parameters:
name- The name of the Differentiable.- Returns:
- true if a Differentiable exists by the name supplied.
-
indexOf
public int indexOf(java.lang.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(java.lang.String name) throws java.lang.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:
java.lang.ClassNotFoundException- if no Differentiable object by that name exists.
-
getDifferentiable
- Parameters:
index- The index of the Differentiable in this DifferentiableManager object. If no such index exists, then it returns null.- Throws:
java.lang.ClassNotFoundException- if no Differentiable object by that name exists.
-
lookUp
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
- Parameters:
diff- The Differentiable object to add to this object.
-
delete
public void delete(java.lang.String name)Removes a Differentiable object from this DifferentiableManager. -
firstDifferentiable
-
lastDifferentiable
-
update
public int update(java.lang.String name, java.lang.String newName)It updates the name of a Differentiable object in this DifferentiableManager with the parameternewName.- 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
-1the Differentiable is not found.
-
update
public int update(java.lang.String name, java.util.ArrayList<java.lang.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
-1the Differentiable is not found.
-
clearAll
public void clearAll()
-