cardgame
Class VectorRandomizer

java.lang.Object
  |
  +--cardgame.VectorRandomizer

public class VectorRandomizer
extends java.lang.Object

The VectorRandomizer class provides a way to arrange the elements of a Java Vector in random order. It uses the RandomIntGenerator class to generate random numbers. VectorRandomizer is especially well suited for shuffling a Deck for use with card games.

Version:
1.0, 3 August 2001
Author:
James A. Webb, www.uberkode.com

Field Summary
private  boolean statisticalMode
          The private variable statisticalMode determines whether statistical information will be sent to standard out.
 
Constructor Summary
VectorRandomizer()
          The no-argument constructor creates an instance of VectorRandomizer.
VectorRandomizer(boolean mode)
          This constructor creates an instance of VectorRandomizer and allows the statistical mode to be set to true.
 
Method Summary
 java.util.Vector randomize(java.util.Vector vectorToBeRandomized)
          The public method randomize takes a Vector and reorders the elements to be in a random order.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

statisticalMode

private boolean statisticalMode
The private variable statisticalMode determines whether statistical information will be sent to standard out. If statisticalMode is set to true, status information about variables used in the randomization process will be sent. If statisticalMode is set to false, the constructor functions exactly like the no-argument constructor.
See Also:
VectorRandomizer(boolean mode), VectorRandomizer()
Constructor Detail

VectorRandomizer

public VectorRandomizer()
The no-argument constructor creates an instance of VectorRandomizer.
See Also:
VectorRandomizer(boolean mode)

VectorRandomizer

public VectorRandomizer(boolean mode)
This constructor creates an instance of VectorRandomizer and allows the statistical mode to be set to true.
See Also:
statisticalMode, VectorRandomizer()
Method Detail

randomize

public java.util.Vector randomize(java.util.Vector vectorToBeRandomized)
The public method randomize takes a Vector and reorders the elements to be in a random order.
Returns:
the randomized Vector.
See Also:
RandomIntGenerator, PlayingCard