Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with search method  RSS feed

 
Gabriel White
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your getLowerCase method look like?
What does your equals method look like?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!