Class VariableGenerator
java.lang.Object
com.github.gbenroscience.util.VariableGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionVariableGenerator(int n) VariableGenerator(int n, boolean genValue) creates a new object of this class that can be used to generate Variables randomlyVariableGenerator(int n, double val) creates a new object of this class that can be used to generate Variables randomly -
Method Summary
Modifier and TypeMethodDescriptionintcodePieces(String aPiece) decodePiece(int code) generateZeroes(int n) getRan()booleanvoidsetGenValue(boolean genValue) sets the state of objects of this classvoid
-
Constructor Details
-
VariableGenerator
public VariableGenerator(int n) -
VariableGenerator
public VariableGenerator(int n, boolean genValue) creates a new object of this class that can be used to generate Variables randomly- Parameters:
n- determines the number of characters that the Variable name will have.genValue- variable that determines if the client needs the randomly generated variable to have a randomly specified value too.
-
VariableGenerator
public VariableGenerator(int n, double val) creates a new object of this class that can be used to generate Variables randomly- Parameters:
n- determines the number of characters that the Variable name will have.val- client specified value for the new Variable to have a randomly specified value too.
-
-
Method Details
-
isGenValue
public boolean isGenValue()- Returns:
- the state of objects of this class that is whether or not they will randomly generate values for Variable objects.
-
setGenValue
public void setGenValue(boolean genValue) sets the state of objects of this class- Parameters:
genValue- the state of the object:that is whether or not they will randomly generate values for Variable objects.
-
getRan
-
setRan
-
generateVariable
-
generateZeroes
-
codePieces
- Parameters:
aPiece- takes a String character that can form a valid part of the name of an object of class Variable and encodes it- Returns:
- the code of the character
-
decodePiece
- Parameters:
code- the number code that hides a character or symbol that can form part of a Variable object's name property.- Returns:
- returns the String character associated with a number code where the character is one that can form a part of the name of an object of class Variable
-