Count a list

Could someone please tell me how to how count status correctly?

I have a large size list and it is broken into a group of smaller lists. I want to show the status when each list is going through the function getNextToSend(). For example, the size of the large list is 105, and it is broken into size 20 for each group. The getNextToSend() method is called 6 times. The first 5 times with 20 list each and the last group size is 5. The simple version of the code is blew. How can I get int generate3 in System.out.println("generate3 is: " + generate3); printed as 1,2.....105. What I got now is it counts from 1 - 20, then it count 1-20. again.

publicclass Counter{

private Vector list;

public HttpSession session;

privateint count = 0;

public Counter(Vector list, HttpServletRequest request){

this.list = list;

this.session = request.getSession();

}

privatesynchronized Profile getNextlToSend(){

if( this.list.size()==0){

returnnull;

}

this.count++;

int generate = Add(this.count++);

session.setAttribute("number" , Integer.toString(generate));

return (Profile)this.list.remove(0);

}

privateint Add(int generate2)

{int generate3 =+ generate2 ;

System.out.println("generate3 is: " + generate3);

return generate3;

}

[2306 byte] By [katieqa] at [2007-10-3 8:10:04]
# 1
Double posted. http://forum.java.sun.com/thread.jspa?threadID=779797Most people read both New to Java and Java Programming forums so you do not need to post your question in both. This is considered rude. Please do not do it again.Provide answers in other thread.
floundera at 2007-7-15 3:14:24 > top of Java-index,Java Essentials,Java Programming...
# 2
Sorry, I didn't know most people read both New to Java and Java Programming. Since no one has helped me with any answers, I thought this question is for "Jave Programming". Is there a way to delete my thread?
katieqa at 2007-7-15 3:14:24 > top of Java-index,Java Essentials,Java Programming...
# 3
> Is there a way to delete my> thread?No, just let this one die out since youre getting help in the other one.
CaptainMorgan08a at 2007-7-15 3:14:24 > top of Java-index,Java Essentials,Java Programming...