jist.swans.misc
Class Enumerator

java.lang.Object
  extended by jist.swans.misc.Enumerator

public class Enumerator
extends java.lang.Object

Class to generate a sequence; used usually for static initialization of constants.

Since:
SWANS1.0
Version:
$Id: Enumerator.java,v 1.4 2004/04/06 16:07:48 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Field Summary
private static int num
          internal sequence counter.
 
Constructor Summary
Enumerator()
           
 
Method Summary
static int next()
          Return next value in sequence.
static int reset()
          Zero counter.
static int reset(int start)
          Reset counter value to given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

num

private static int num
internal sequence counter.

Constructor Detail

Enumerator

public Enumerator()
Method Detail

reset

public static int reset(int start)
Reset counter value to given value.

Parameters:
start - value to reset counter to
Returns:
the same value that the counter was reset to

reset

public static int reset()
Zero counter.

Returns:
zero

next

public static int next()
Return next value in sequence.

Returns:
next value in sequence