org.mmbase.util
Class RandomThings

java.lang.Object
  extended by org.mmbase.util.RandomThings

public class RandomThings
extends Object

Class for doing random things.

Version:
$Id: RandomThings.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Rico Jansen
Deprecated-now:
not used anywhere

Constructor Summary
RandomThings()
           
 
Method Summary
static Vector<Object> giveRandomFrom(Vector<Integer> v, int max)
          Return 'max' random elements from a Vector.
static void main(String[] args)
          entrypoint for calling this class from the commandline For testing
static void shuffleArray(int[] arr)
          Deprecated. use java.util.
static Vector<Object> shuffleCloneVector(Vector<Integer> v)
          Deprecated. java.util.Collections#shuffle and clone
static void shuffleVector(Vector<Object> v)
          Deprecated. java.util.Collections#shuffle
 
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(Vector<Object> v)
Deprecated. java.util.Collections#shuffle

Shuffle a Vector until it is a Random mess


shuffleCloneVector

public static Vector<Object> shuffleCloneVector(Vector<Integer> v)
Deprecated. java.util.Collections#shuffle and clone

Return a new Shuffled vector


shuffleArray

public static void shuffleArray(int[] arr)
Deprecated. use java.util.

Shuffle an integer array


giveRandomFrom

public static Vector<Object> giveRandomFrom(Vector<Integer> v,
                                            int max)
Return 'max' random elements from a Vector. No duplicates will be given.


main

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



MMBase 2.0-SNAPSHOT - null