S
ses
So I find myself using rather a lot of maps in my latest piece of work
to represent nested objects e.g:
HashMap<Integer, HashMap<Integer,String>>
Where for example the first and second integers are attributes and
string is some value that an Integer-Integer combination corresponds
to. I only ever need to really put and get the String value based on
the Integer attributes, but it seems a more effective tree like
structure than using a custom data structure and having to iterate
over it.
My question is, should I be worried about using maps in this manner,
would a custom data structure be better? I think I'm becoming too used
to using them.
to represent nested objects e.g:
HashMap<Integer, HashMap<Integer,String>>
Where for example the first and second integers are attributes and
string is some value that an Integer-Integer combination corresponds
to. I only ever need to really put and get the String value based on
the Integer attributes, but it seems a more effective tree like
structure than using a custom data structure and having to iterate
over it.
My question is, should I be worried about using maps in this manner,
would a custom data structure be better? I think I'm becoming too used
to using them.