Package math.differentialcalculus
Class DifferentiableManager
java.lang.Object
math.differentialcalculus.DifferentiableManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayList<Differentiable>
Records all differentiables used by the function to be differentiated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Differentiable diff) void
clearAll()
boolean
int
count()
void
Removes a Differentiable object from this DifferentiableManager.getDifferentiable
(int index) getDifferentiable
(String name) int
Attempts to retrieve a Differentiable object from a DifferentiableManager based on its name.int
It updates the name of a Differentiable object in this DifferentiableManager with the parameternewName
.int
Updates a Differentiable object in this DifferentiableManager.
-
Field Details
-
DIFFERENTIABLES
Records all differentiables used by the function to be differentiated.
-
-
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
- Parameters:
name
- The name of the Differentiable.- Returns:
- true if a Differentiable exists by the name supplied.
-
indexOf
- 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
- 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
- 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
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
Removes a Differentiable object from this DifferentiableManager. -
firstDifferentiable
-
lastDifferentiable
-
update
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
-1
the Differentiable is not found.
-
update
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()
-