Searching on ArrayList

Hi everyone, I am trying to do a search in an arraylist of objects books from a class called Catalogue. The book class has a string description and a borrower number (which is set up to 0, meaning not on loan).

I should be able to borrow a book once I've done a search, and this search has to found only ONE book.

there it is the code that I have got so far.. could somebody help me?

public void Search(String entry, int borrower)

{

for(Book book : books){

if (book.getDescription().equals(entry) || book.getDescription().contains(entry)){

searchNumber++;

System.out.println(searchNumber + " " + book.getDescription()); }

if (book.getBorrowerNumber() == 0 && book.getDescription().equals("")){

searchNumber++;

System.out.println(searchNumber + " " + book.getDescription());}

if (book.getBorrowerNumber() == borrower && book.getBorrowerNumber() != 0){

searchNumber++;

System.out.println(searchNumber + " " + book.getDescription());}

}

if(searchNumber ==1 ){

Book.setBorrowerNumber(int yourID());

if(borrower==0){

System.out.print("please enter your ID number");}

}

else{

System.out.println("search Better");}

}

[1285 byte] By [virkofa] at [2007-11-27 1:49:10]
# 1
This is a continuation of a previously replied to thread here: http://forum.java.sun.com/thread.jspa?threadID=5163333&messageID=9623731Post replies to that thread, not this one.
ChuckBinga at 2007-7-12 1:14:08 > top of Java-index,Java Essentials,New To Java...