KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > util > sequence > SequenceBatch


1 /**
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.util.sequence;
5
6 public class SequenceBatch {
7   private long current;
8   private long end;
9
10   public SequenceBatch(long current, long end) {
11     this.current = current;
12     this.end = end;
13   }
14
15   public boolean hasNext() {
16     return current < end;
17   }
18
19   public long next() {
20     return current++;
21   }
22   
23   public String JavaDoc toString() {
24     return "SequenceBatch@" + System.identityHashCode(this) +"[ current = " +current + " , end = "+ end + " ]";
25   }
26 }
Popular Tags