net.sf.saxon.exslt
Class Random

java.lang.Object
  extended by net.sf.saxon.exslt.Random

public abstract class Random
extends Object

This class implements extension functions in the http://exslt.org/random namespace.

Version:
1.0, 30.06.2004 Rewritten by Michael Kay to generate a SequenceIterator
Author:
Martin Szugat

Constructor Summary
Random()
           
 
Method Summary
static DoubleValue randomSequence()
          Returns a single random number X between 0 and 1.
static SequenceIterator randomSequence(int numberOfItems)
          Returns a sequence of random numbers between 0 and 1.
static SequenceIterator randomSequence(int numberOfItems, double seed)
          Returns a sequence of random numbers between 0 and 1.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Random

public Random()
Method Detail

randomSequence

public static SequenceIterator randomSequence(int numberOfItems,
                                              double seed)
                                       throws IllegalArgumentException
Returns a sequence of random numbers between 0 and 1.

Parameters:
numberOfItems - number of random items in the sequence.
seed - the initial seed.
Returns:
sequence of random numbers as an iterator.
Throws:
IllegalArgumentException - numberOfItems is not positive.

randomSequence

public static SequenceIterator randomSequence(int numberOfItems)
                                       throws IllegalArgumentException
Returns a sequence of random numbers between 0 and 1.

Parameters:
numberOfItems - number of random items in the sequence.
Returns:
sequence of random numbers.
Throws:
IllegalArgumentException - numberOfItems is not positive.

randomSequence

public static DoubleValue randomSequence()
                                  throws XPathException
Returns a single random number X between 0 and 1.

Returns:
sequence random number.
Throws:
XPathException


Copyright (C) Michael H. Kay. All rights reserved.