I've painted myself into a bit of a corner. Havning finally really wrapped my head around the handiness and functionality of references, I designed a data structure which is quite elegant... or at least clear and functional for my purposes.
To make this as simple as possible -- I've got two classes A and B. When I load a midi file, the data from the midi file is organized into a number of A objects and a number of B objects. A objects basically contain vertical data (harmony), while B objects contain horizontal data (motives). The A objects hold references to B objects, and vice versa.
I'm trying to save all this data in a file. In order to access the data, I've loaded all of the A objects from an analyzed midi file into a HashMap: Map. However, when I save Map, it appears that the actual data from the B objects gets left behind -- if I query the B data from a loaded Map file, I get NullPointerExceptions, suggesting that there's no B data stored. Because the A objects are actually loaded to the Map and saved, all of the A object data appears to be intact.
So, how can I save the Map in such a way as to also save the referenced B data?
Does that question make any sense? Is this Java 101?