Qizx/open API

net.axyana.qizxopen.util
Class RandomGene

java.lang.Object
  extended bynet.axyana.qizxopen.util.RandomGene

public class RandomGene
extends java.lang.Object

Utilities for random generation of data. Used as XQuery Java extension functions.


Nested Class Summary
static class RandomGene.IdGenerator
           
static class RandomGene.RandomSelector
           
 
Constructor Summary
RandomGene()
           
 
Method Summary
static RandomGene.IdGenerator generator()
          Simple id generator.
static int idGenerate(RandomGene.IdGenerator generator)
           
static int random(long range)
          Returns a number between 1 and N, with decaying probability
static java.lang.Object select(RandomGene.RandomSelector selector)
           
static RandomGene.RandomSelector selector(java.lang.Object[] data)
          random selector of an object in a list.
static int xrandom(double decay)
          Returns a number between 1 and N, with decaying probability
static java.lang.Object xselect(RandomGene.RandomSelector selector, double decay)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomGene

public RandomGene()
Method Detail

selector

public static RandomGene.RandomSelector selector(java.lang.Object[] data)
random selector of an object in a list.


select

public static java.lang.Object select(RandomGene.RandomSelector selector)

xselect

public static java.lang.Object xselect(RandomGene.RandomSelector selector,
                                       double decay)

generator

public static RandomGene.IdGenerator generator()
Simple id generator.


idGenerate

public static int idGenerate(RandomGene.IdGenerator generator)

random

public static int random(long range)
Returns a number between 1 and N, with decaying probability


xrandom

public static int xrandom(double decay)
Returns a number between 1 and N, with decaying probability


© 2005 Axyana Software