title: Would HashMap provide efficient access to object arrays by a string type?
body: <p>I'm working on a game and I got the Main class which holds a number of object references arrays.</p>
  
  <p>In the main class, I loop through every array and update the objects. The problem is that I have to hold an array for each type of object. It's comfortable to have an array for each type but it'd make the code ugly when I'll have dozens of types.</p>
  
  <p>I thought about having a HashMap of String|Array, and every entry would have the object type name (String) and the array itself. Every object extends an abstract class I made called GameObject. My question is that efficient to work with hashmap? (meaning in every loop the Main class gets an array from the map and runs through it's objects.)
  By efficient I mean if HashMap's "get" method can slow down things.</p>
  
  <p>Or maybe there are better solutions for holding lots of objects with different types?</p>
  
  <p>I'm developing the game in Java, to Android, using LibGDX.
  Thank you!</p>