Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
- class NodeInfo{
- private String name;
- private String parentID;
- private String link;
- private String hidden;
- private String id;
- public NodeInfo(String id,String name,String pid,String hidden,String link) {
- this.name = name;
- this.parentID = pid;
- this.link = link;
- this.hidden = hidden;
- this.id = id;
- }
- void showInfo() {
- System.out.println("This method works and would print out the node with indent");
- }
- }
- public class TreeNodes {
- public static void main(String[]args) throws IOException{
- FileReader in = new FileReader("Navigation.csv");
- BufferedReader br = new BufferedReader(in);
- String line;
- line = br.readLine();
- NodeInfo nodeList[] = new NodeInfo[100];
- int counter = 0;
- while ((line = br.readLine()) != null) {
- String [] cells = line.split(";");
- NodeInfo newNode =new NodeInfo(cells[0], cells[1], cells[2], cells[3], cells[4]);
- nodeList[counter] = newNode;
- counter++;
- System.out.println(line);
- }
- // nodeList[8].showInfo();
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement