P
Paul
I need to store info where all elements are of the form
ID (an int) --> (ObjType1, ObjType2)
The question is, is there a way of storing O1 and O2 in some kind of an
entrySet instead of using a full-blown map?
That is, instead of doing
Map<Integer, Map<ObjType1, ObjType2>> myMap = new HashMap<Integer,
Map<ObjType1, ObjType2>>();
can I somehow instantiate a new Entry object and store that instead of
an entire map (i.e. Map<Integer, Map.Entry<ObjType1, ObjType2>>)?
The only alternative I see to storing a separate map with each
int-->object pair entry, is making the overall structure to be
Map<Integer, Object[]> but then I'd need to cast the objects out of the
Object[] each time I use them.
If those ARE the only two options I have, which one is faster, casting
every time, or storing each elements pair as a separate Map?
Thanks!
ID (an int) --> (ObjType1, ObjType2)
The question is, is there a way of storing O1 and O2 in some kind of an
entrySet instead of using a full-blown map?
That is, instead of doing
Map<Integer, Map<ObjType1, ObjType2>> myMap = new HashMap<Integer,
Map<ObjType1, ObjType2>>();
can I somehow instantiate a new Entry object and store that instead of
an entire map (i.e. Map<Integer, Map.Entry<ObjType1, ObjType2>>)?
The only alternative I see to storing a separate map with each
int-->object pair entry, is making the overall structure to be
Map<Integer, Object[]> but then I'd need to cast the objects out of the
Object[] each time I use them.
If those ARE the only two options I have, which one is faster, casting
every time, or storing each elements pair as a separate Map?
Thanks!