Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static BST<Morse> ler() throws FileNotFoundException, UnsupportedEncodingException, IOException {
- MorseTree mt = new MorseTree();
- BST<Morse> bst = mt.getBst();
- bst.insert(new Morse("Start", " ", null));
- File fileDir = new File(file_name);
- BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileDir), "UTF8"));
- lerTotal(in, bst);
- in.close();
- return bst;
- }
- public static void lerTotal(BufferedReader in, BST<Morse> bst) throws IOException {
- String str;
- while ((str = in.readLine()) != null) {
- String tmp[] = str.split(" ");
- Morse m = new Morse(tmp[0], tmp[1], tmp[2]);
- bst.insert(m);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement