Advertisement
moreiramota

Untitled

Dec 6th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public static BST<Morse> ler() throws FileNotFoundException, UnsupportedEncodingException, IOException {
  2. MorseTree mt = new MorseTree();
  3. BST<Morse> bst = mt.getBst();
  4. bst.insert(new Morse("Start", " ", null));
  5. File fileDir = new File(file_name);
  6. BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileDir), "UTF8"));
  7. lerTotal(in, bst);
  8. in.close();
  9. return bst;
  10. }
  11.  
  12. public static void lerTotal(BufferedReader in, BST<Morse> bst) throws IOException {
  13. String str;
  14. while ((str = in.readLine()) != null) {
  15. String tmp[] = str.split(" ");
  16. Morse m = new Morse(tmp[0], tmp[1], tmp[2]);
  17. bst.insert(m);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement