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: 2015/10/15 07:16 by yehuda
Back to top
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0