01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */package com.tc.util.sequence;
05:
06: public class SequenceBatch {
07: private long next;
08: private long end;
09:
10: public SequenceBatch(long next, long end) {
11: this .next = next;
12: this .end = end;
13: }
14:
15: public boolean hasNext() {
16: return next < end;
17: }
18:
19: public long next() {
20: return next++;
21: }
22:
23: public long current() {
24: return next - 1;
25: }
26:
27: public String toString() {
28: return "SequenceBatch@" + System.identityHashCode(this )
29: + "[ next = " + next + " , end = " + end + " ]";
30: }
31: }
|