Solved

finding size

Posted on 2002-05-08
2
165 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 39
mapAB Challlenge 35 126
Unexpected HttpURLConnection connection behavior 2 86
eclipse argument 14 53
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now