title: Best Collection To Use?
body: <p>I am reading log files but not all lines want to be processed straight away. I am using a queue / buffer to store the lines while they wait to be processed.</p>
  
  <p>This queue is regularly scanned for particular lines - when they are found, they are removed from the queue (they can be anywhere in it). When there isn't a particular line to be found, lines are taken out of the start of the queue one by one to be processed.</p>
  
  <p>Therefore, the queue needs the following:</p>
  
  <ul>
  <li>Able to be resized (or give that impression)</li>
  <li>Have elements removed from anywhere</li>
  <li>Have elements added (will always be at the end of the queue)</li>
  <li>Be scanned quickly</li>
  <li>Depending on performance, have a pointer of where it got to on the last scan.</li>
  </ul>
  
  <p>I initially wrote the code when I had little experience of Java or the API, and just used an ArrayList because I knew it would work (not necessarily because it was the best option).</p>
  
  <p>Its performance is now becoming poor with more and more logs needing to be processed - so, what collection would you recommend to be used in this situation? There's always the possibility of writing my own too.</p>
  
  <p>Thanks</p>