This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am trying to get a clean 15 characters after and before a target word but if the word is on either side repeated in those characters, I want to select the characters only before that. In the second method "java" I am trying to do this but not being very successful. Please read code and help
The class ConditionPosition is just a wrapper. See it here:
[ February 07, 2008: Message edited by: Bill Shirley ]
Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Joined: May 09, 2002
I used code tags
I really need top-notch speed because this method will be used in applet that will be searching in thousands of files on the client. Don't worry about permissions. I have tested that already So you see I want int array.
I haven't looked at what the code does in detail, but if you're reading from that many files, then file I/O speed is going to drown out any difference there could conceivably be between using arrays and using collections.
time taken by my code with following conditions: median 469 milliseconds - BufferedReader.readLine(); // read 39245 lines // checked them all for condition if(String.toLowerCase().indexOf("behave")>-1)
median 344 milliseconds - BufferedReader.readLine();// read 39245 lines only.
125 milliseconds difference for if statement only.