Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isWord(builder_.toString())) {
- synchronized (result) {
- switch(result.isEmpty() ? 0 : 1) {
- case 0:
- result.add(builder_.toString());
- break;
- case 1:
- stripped_ = strp(builder_.toString());
- Iterator<String> iterator_ = result.iterator();
- while(iterator_.hasNext()) {
- String rel = iterator_.next();
- if(stripped_.equals(strp(rel))) {
- // checking to see if the word has been added already 3 times
- // if it has, it means It's an infinite loop, thus we stop
- if(infinite_ >= 3) {
- result.add(builder_.toString());
- return;
- }
- } else {
- infinite_ += 1;
- result.add(builder_.toString());
- }
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement