title: Length of a 2D Array inside a HashMap
body: <p>I am having a little bit of trouble figuring out some complicated logic required for a program at work. </p>
  
  <p>This program is designed to compare "transactions" between two folders. Each folder can contain any number of files and each file (XML Document) can contain any number of transactions. Each transaction will have 5 tags.  </p>
  
  <p>I must compare two folders and see if any transactions match. </p>
  
  <p>To do this, I am using a <code>HashMap</code> and putting a <code>String[][]</code> array inside of it. Each key in the <code>HashMap</code> will represent 1 file. The row in the String will represent a transaction and the columns will represent the tags. </p>
  
  <p>I'm having trouble figuring out how to access the <code>String[][]</code> from within the <code>HashMap</code>. I need to get the number of transactions (rows). </p>
  
  <p>Here is how I do the above:</p>
  
  <pre><code>// Creating the HashMap and Array[][]
  public static Map&lt;Integer, String[][]&gt; Pain008TransactionsCollection = new HashMap();
  public static String[][] Pain008Transactions;
  
  //Here is the logic where I populate the HashMap.
  int transactionSize = EndToEndId.size();
  
  //Creates a 2D array with one dimension for each transaction and six dimensions
  //for relevant tags + filename.
  Pain008Transactions = new String[transactionSize][6];
  
  //For each transaction..
  for(int i = 0; i &lt; transactionSize; i++){
  
      //Below will add each value into the 2D array for each transaction. Note that the
      //filename is also added so that it can be easily associated with a transaction later.
      Pain008Transactions[i][0]=EndToEndId.get(i);
      Pain008Transactions[i][1]=InstdAmt.get(i);
      Pain008Transactions[i][2]=MmbId.get(i);
      Pain008Transactions[i][3]=DbtrNm.get(i);
      Pain008Transactions[i][4]=OthrId.get(i);
      Pain008Transactions[i][5]=GetFiles.pain008Files.get(currentFile).toString();
  
  }
  
  //Puts the 2D array into the collections map at the position of the current 
  //file in sequence.
  Pain008TransactionsCollection.put(currentFile, Pain008Transactions);
  
  System.out.println(Pain008TransactionsCollection);
  </code></pre>
  
  <p>I know that to get the total number of <code>HashMap</code> key's I use this:</p>
  
  <pre><code>Pain008TransactionsCollection.size()
  </code></pre>
  
  <p>and I know to get the rows for the String[][] I use</p>
  
  <pre><code>Pain008Transactions.length()
  </code></pre>
  
  <p>But I am not sure how to call the <code>HashMap</code> key and then get the row length for that particular key. </p>
  
  <p>Any help would be really appreciated. </p>