proper.util
Class RandomID

java.lang.Object
  extended by proper.util.RandomID
All Implemented Interfaces:
java.util.Enumeration

public class RandomID
extends java.lang.Object
implements java.util.Enumeration

This class can produce an amount of randomized Integer-IDs.

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
RandomID(int count)
          initializes the object with the given number of ids (numbers from 0 to count - 1)
RandomID(int count, int from)
          initializes the object with the given number of ids starting from "start" (numbers from "start" - "start + count - 1")
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 java.lang.Object nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomID

public RandomID(int count)
initializes the object with the given number of ids (numbers from 0 to count - 1)


RandomID

public RandomID(int count,
                int from)
initializes the object with the given number of ids starting from "start" (numbers from "start" - "start + count - 1")

Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface java.util.Enumeration

nextElement

public java.lang.Object nextElement()
                             throws java.util.NoSuchElementException
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface java.util.Enumeration
Throws:
java.util.NoSuchElementException