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.test;
04:
05: /**
06: * generates a sequence of unique ints for all kinds of test purposes.
07: * NOTE: this sequence starts from 0 and will be reset every time JVM is restarted.
08: */
09: public class UniqueSequenceGenerator {
10:
11: public static UniqueSequenceGenerator getInstance() {
12: return theInstance;
13: }
14:
15: public synchronized int getNextInt() {
16: return this .currentValue++;
17: }
18:
19: private UniqueSequenceGenerator() {
20: super ();
21: }
22:
23: private static UniqueSequenceGenerator theInstance = new UniqueSequenceGenerator();
24:
25: private int currentValue = 84925;
26: }
|