01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */package com.tc.util;
04:
05: public class SequenceGenerator {
06:
07: private long seq;
08:
09: public SequenceGenerator() {
10: this (0);
11: }
12:
13: public SequenceGenerator(long start) {
14: this .seq = start - 1;
15: }
16:
17: public synchronized long getNextSequence() {
18: return ++seq;
19: }
20:
21: public synchronized long getCurrentSequence() {
22: return seq;
23: }
24: }
|