aspose file tools*
The moose likes Beginning Java and the fly likes problem with search method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem with search method" Watch "problem with search method" New topic
Author

problem with search method

Gabriel White
Ranch Hand

Joined: Mar 02, 2003
Posts: 233
Hey yall, I have a quick question on a project I am working on. What would be the best way to fix this problem? I am attempting to search through a circularList array that I just inserted a lower case word, from a text file, and when I try my search, I keep getting a zero returned. This is by design, but the search method is supposed to return the number of int's that it counted before it found the word in the Linked List. The WordCounter class is a typical word counter class which converts words from a file to lowercase or strips non letters from the word from a file. Now, the wordCounter class is working correctly, so I am not to worried about that, but I am worried about my WordStats class which contains this search method.
Here is the search method code.



as you can see, I've tried a few different things to get it to do what it is supposed to do.
incedently, temp is/ was myLast.next, which is my ListNode in my circluarList class.
Thanks in advance.
[ April 03, 2004: Message edited by: Gabriel White ]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
What does your getLowerCase method look like?
What does your equals method look like?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with search method