org.mmbase.util
Class RandomThings

java.lang.Object
  |
  +--org.mmbase.util.RandomThings

public class RandomThings
extends java.lang.Object

Class for doing random things.

Author:
Rico Jansen

Constructor Summary
RandomThings()
           
 
Method Summary
static java.util.Vector giveRandomFrom(java.util.Vector v, int max)
          Return 'max' random elements from a Vector.
static void main(java.lang.String[] args)
          entrypoint for calling this class from the commandline For testing
static void shuffleArray(int[] arr)
          Shuffle an integer array
static java.util.Vector shuffleCloneVector(java.util.Vector v)
          Return a new Shuffled vector
static void shuffleVector(java.util.Vector v)
          Shuffle a Vector until it is a Random mess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomThings

public RandomThings()
Method Detail

shuffleVector

public static void shuffleVector(java.util.Vector v)
Shuffle a Vector until it is a Random mess

shuffleCloneVector

public static java.util.Vector shuffleCloneVector(java.util.Vector v)
Return a new Shuffled vector

shuffleArray

public static void shuffleArray(int[] arr)
Shuffle an integer array

giveRandomFrom

public static java.util.Vector giveRandomFrom(java.util.Vector v,
                                              int max)
Return 'max' random elements from a Vector. No duplicates will be given.

main

public static void main(java.lang.String[] args)
entrypoint for calling this class from the commandline For testing


MMBase 2001