java - Text file is processed using Hashmap containing List(of maps) as values-How to process? -


my text file contains datas like... dept->studentid-studentdata(name , email)..
it-> 1->john->john@ymail.com
cse->2->santosh->s@gmail.com
it->3->mike->mike@ymail.com
first,i have stored studentid key , studentdata , dept values in hashmap , added in arraylist(list of multiple objects-each list object each row). now, dept key, how retrieve studentid , studentdata list? say, map key, how take data list , store value key? ( should display both matching rows it).

new working collections , in advance given complete this.

why not use student object instead of arraylist. make code more organized.

make hashmap < string, student > string student id , student class student attributes.

class student{      string name;      string dept;      string email;       /** getters & setters **/  } 

so next time go map.get("student_id_here").getname() or getdept() etc..


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -