iglu.util
Class Sequence

java.lang.Object
  |
  +--iglu.util.Sequence

public class Sequence
extends java.lang.Object

Implements an automatic sequence of integers. The sequence is not save between runs of the program. This is useful for generating unique id numbers.

Author:
Travis Bauer

Field Summary
private  long current
          the counter
 
Constructor Summary
Sequence()
          Creates a new sequence starting at 0
Sequence(int n)
          Creates a new sequence starting at n
 
Method Summary
 java.lang.Long getNext()
          Returns the next number in the sequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

private long current
the counter

Constructor Detail

Sequence

public Sequence()
Creates a new sequence starting at 0


Sequence

public Sequence(int n)
Creates a new sequence starting at n

Method Detail

getNext

public java.lang.Long getNext()
Returns the next number in the sequence