parsing - How to access and retrive Sets, Maps, and others variables from an FXMLController using Java 8 -
summary: i using javafx fxml load text file fxmlparsemecontroller.java , perform few parses , edits via class called readfile.java. so, load text file --> pass class -->for each complete line gets edited pass contructor pattern match assign found matches variables, hashmap or sets. missing link how access parsed , new assigned values fxml..controller class?
my setup: after controller load stage , select file, pass "filepath" readfile class. , testing, printout new modified lines after parse via console.
fxmlparsemecontroller.java
readfile file = new readfile(filepath); list<string> arylines = file.openfile(); arylines.foreach(system.out::println); readfile.java
public class readfile { private string path; readfile(string filepath) { path = filepath; } public list<string> openfile() throws ioexception { try (bufferedreader br = new bufferedreader(new filereader(path))) { string line; stringbuilder concatenatedline = new stringbuilder(); list<string> formattedstrings = new arraylist<>(); //few while loops , if statements, pass: testscan(concatenatedline); } private void testscan(stringbuilder concatenatedline) { if (..) { string str1 = "some value"; }else if (...){ set<string> str2 = new treeset<string>(); str2.add("value"); } now, how can retrieve or display string str1 , set str2 fxmlparsemecontroller.java?
Comments
Post a Comment