how to read the ArrayList inside HashMap
I´ve a problem by reading the ArrayList inside the HashMap.
I have a class, to fill this HashMap:
Map<String, MSFlank> flanks = new HashMap<String, MSFlank>();
This HashMap is going to fill the Map on MSFlank-class.
On that MSFlank-class, I have another ArrayList:
private List<MSTooth> mstooths = new ArrayList<MSTooth> ();
and on that MSTooth-class, I have another ArrayList:
private List<MSProfile> msprofiles = new ArrayList<MSProfile> ();
So... what I need right now is, on another class, I need to read the value on MSProfile ListArray.
So I made a List on that class like this:
private List<MSProfile> list_y = new ArrayList<MSProfile>();
And to fill the list, I made a constructor like this:
list_y = msDataModel.getMSFlank().get(RIGHT).getMSTooth().g et(0).getMSProfile();
But.... I got the error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
Can someone help me, how can I fix it?
Thank you very much for the help.