Code examples

public class Polling <long> implements Iterator<long> {
 
		long[] sleepA = [1,10,33,77,200,3000]
		long sleepIdx = 0;
 
		public void setPolling(long[] pollTable){
		  sleepA = pollTable;
		}
 
    public boolean hasNext() {
      return true;
    }
 
    public long next() {
        if(success)
					sleepIdx=0
				else
				  if(sleepIdx<sleepA.length-1)
					  sleepIdx++
    }
 
}
 
 
do{
		sleep(In.next());
}while(In.hasMore())
examples/code_examples.txt · Last modified: 2022/01/03 16:03 by 127.0.0.1
Back to top
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0