title: retrieve instantiated objects from hashmap
body: <p>I really didn't want to resort to asking, however I'm at a dead end. I'm trying to build an array of objects stored within a hashmap into a single array. I'm building a minecraft plugin, and I need to be able to do this in order to reset all players to their natural state. However, for whatever reason, I can't seem to actually parse the Spectator[] array into individual pieces.</p>
  
  <p>The goal is simply to allow more than 1 person to spectate. Here's my code:</p>
  
  <pre><code>public class EagleEye extends JavaPlugin implements Listener{
  
  public HashMap&lt;Spectatee, Spectator[]&gt; spec = new HashMap(Spectatee, Spectator[]);
  public HashMap&lt;Spectatee, Spectator[]&gt; orinven = new HashMap&lt;Spectatee, Spectator[]&gt;;
  public HashMap&lt;Spectatee, Spectator[]&gt; eeinven = new HashMap&lt;Spectatee, Spectator[]&gt;;
  
  @Override
  public void onEnable()
  {
      //TODO:Who knows.
  }
  @Override
  public void onDisable()
  {
      //TODO:Spec off any players being spectated and spectating.
  
      Spectator[] frickinhell = spec.get(key)); 
      //Creates a master list of all spectators by uuid
      for(Spectator spec : spec.get(Spectator.class))
      {
          master.add(spec);
      }
      for(Object spec : master.toArray())
      {
          //Verify the player is online
          if(Bukkit.getPlayer(master)
              {
              //Verify the player is still spectating
              if(tators.get(uuid) == true)
              {
                  //Stop spectating
                  tators.put(uuid, false);
              }
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>I understand that much of this code is broken. However, my main concern is taking Spectator[] stored within all instances of Spectators[] stored within the hashmap and resetting their values to their defaults. Once I can access each individual instance of each object itself, I can reset their respective values using setters.</p>
  
  <p>Cheers.</p>