title: Java ArrayList looking for multiple strings
body: <p>Let's say I have two same strings inside an ArrayList... is there a way to check for that? Also is there a way to check for how many times a string of the same exact is in the ArrayList?</p>
  
  <p>So let's say I have the following a ArrayString.</p>
  
  <pre><code>os.println(itemIDdropped + "|" + spawnX + "|" + spawnY + "|" + currentMap + "|drop|" + me.getUsername());
  1. 1|3|5|1|drop|Dan
  2. 2|5|7|2|drop|Luke
  3. 1|3|5|2|drop|Dan
  4. 3|3|5|1|drop|Sally
  </code></pre>
  
  <p>Here is what the numbers/letters mean for the 1-4 strings...
  item ID, X pos, Y pos, Map it's on, command drop, user who dropped it</p>
  
  <p>Then let's say I split it up doing this:</p>
  
  <pre><code>String[] itemGrnd = serverItems.get(i).split("\\|");
  </code></pre>
  
  <p>Now, let's say I have a for-loop like this one:</p>
  
  <pre><code>for (int i = 0; x &lt; serverItems.size(); i++) {
      System.out.println(serverItems.get(i));
  }
  </code></pre>
  
  <p>I want to find where X, Y, and Map or in this case itemGrnd[1], itemGrnd[2], and itemGrnd[3] are the same in ANY other String in the ArrayList I found via serverItems.get(i).</p>
  
  <p>And if WE DO find any... (which in the example I provide above... x, y, and map are the same for 1 and 4... then create an IF statment to do it ONCE... because I don't want to do this:
  (BTW I do keep track of my variables for client-side so don't worry about that. Yes I know it's named spawnX and spawnY.. that's just the current X,Y.</p>
  
  <pre><code>if (spawnX.equals(Integer.parseInt(itemGrnd[1])) &amp;&amp; 
      spawnY.equals(Integer.parseInt(itemGrnd[2])) &amp;&amp;
      currentMap.equals(Integer.parseInt(itemGrnd[3]))) {
  }
  </code></pre>
  
  <p>Now, if I were to do THIS.... 1 and 4 were be processed through here. I Only want do it ONCE.. at ALL times if we find multple strings (like 1 and 4)</p>
  
  <p>Thanks</p>