Solved

finding size

Posted on 2002-05-08
2
182 Views
Last Modified: 2011-09-20

if you take a look at my last question you will get a better understanding!

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=java&qid=20298016

how could i find out how many documents their is in the queue?

what is the total size of the queue?

cheers
0
Comment
Question by:penfold69
  • 2
2 Comments
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 90 total points
ID: 6996801
   Hi!

  You could do something like this
         
         public int displayAll()
         {
              int iCount = 0;
              QueueNode temp = new QueueNode();
             
              temp = start;
              while (temp !=null)
              {
                   if(temp.DocumentName != ""){
                      iCount++;
                   }
                   temp = temp.next;
              }
             return iCount;
         }    

   Regards,
     Tomas Helgi
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 6996807
Hi!

I didn't change the function name :(
It should be more describeing like

public int getDocumentCount(){
....
}

Regards,
  Tomas Helgi
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question