Class DataSetFormatter
java.lang.Object
parser.DataSetFormatter
Objects of this class take a data-set and simplify/reduce its complexity so
that class MathExpression can easily work with it.
The ultimate goal is to convert every data in the data-set into a number or a
simple variable.
- Since:
- Sunday August 07 2011
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDataSetFormatter
(String datastring) Takes a comma separated string of data values and scans them into its dataset attribute. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
private void
processCommasInSingleBracketPair
(List<String> sbpList) final void
scanCommaSeparatedData
(String myStr) root(@(x)sin(x)-x,2,3)void
setDataset
(ArrayList<String> dataset)
-
Field Details
-
dataset
-
COMMA_MASK
used to mask the commas after they have been processed.- See Also:
-
OPEN_BRACKET_MASK
used to mask the commas after they have been processed.- See Also:
-
CLOSE_BRACKET_MASK
used to mask the commas after they have been processed.- See Also:
-
-
Constructor Details
-
DataSetFormatter
Takes a comma separated string of data values and scans them into its dataset attribute.- Parameters:
datastring
- A comma separated data set. e.g 2,3,......or sort(2,3,1,5,...) or mode(1,8,...)
-
-
Method Details
-
setDataset
-
getDataset
-
getFormattedDataSet
- Returns:
- a formatted data-set.
-
processCommasInSingleBracketPair
-
scanCommaSeparatedData
root(@(x)sin(x)-x,2,3)- Parameters:
myStr
- A String containing a data that uses commas to separate values. It attacks the commas and encloses the values and other data between commas with brackets. e.g sort(2,sin(3),4,log,(,3*a+12,sum,(,2,3,),),log,(,3,10,)....) becomes sort( (2),(sin(3)),(4)....)
-
main
-