Package util
Class Formulae
java.lang.Object
util.Formulae
public class Formulae
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Formulae(java.lang.String expr) -
Method Summary
Modifier and Type Method Description java.lang.StringgetDescription()java.lang.StringgetExpression()java.lang.StringgetVariable()booleanisValidFormula()voidsetDescription(java.lang.String description)Sets the description of the FormulavoidsetFormula(java.lang.String expression)sets the formula or rather the expression( to the right of the equals sign ) to be equal to the parameter given below.voidsetValidFormula(boolean validFormula)voidsetVariable(java.lang.String variable)sets the variable name to the given value.java.lang.StringtoString()
-
Constructor Details
-
Formulae
public Formulae(java.lang.String expr)
-
-
Method Details
-
getExpression
public java.lang.String getExpression()- Returns:
- the formula's expression i.e the quantity to the right of the equals sign.
-
setFormula
public void setFormula(java.lang.String expression)sets the formula or rather the expression( to the right of the equals sign ) to be equal to the parameter given below.- Parameters:
expression- the formula itself i.e the quantity to the right of the equals sign.
-
getVariable
public java.lang.String getVariable()- Returns:
- the variable string that we set to be equal to the formula
-
setVariable
public void setVariable(java.lang.String variable)sets the variable name to the given value.- Parameters:
variable- the dependent variable that the formulae after evaluation will store its value in.
-
isValidFormula
public boolean isValidFormula()- Returns:
- returns true if the software can model a valid Formula object from the user's input
-
setValidFormula
public void setValidFormula(boolean validFormula)- Parameters:
validFormula- set this to true if the software can model a valid Formula object from the user's input
-
getDescription
public java.lang.String getDescription()- Returns:
- the description of the Formula
-
setDescription
public void setDescription(java.lang.String description)Sets the description of the Formula- Parameters:
description- the description of the Formulae
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object- Returns:
- the String representaion of the Formulae object
-