Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.pokersource.util
Class NestedLoopSampling

    java.lang.Object
      org.pokersource.util.NestedLoopSampling

All Implemented Interfaces:
  java.util.Enumeration

    public class NestedLoopSampling

extends java.lang.Object
implements java.util.Enumeration

Like NestedLoopEnumeration, but rather than visiting every entry in turn, randomly samples with replacement.

Author:
  Michael Maurer <mjmaurer@yahoo.com>
See Also:
  `NestedLoopEnumeration`

Field Summary
`private int[]` | `elem`
`private int[]` | `limits`
`private int` | `nsamples`
`private java.util.Random` | `rand`

Constructor Summary
`NestedLoopSampling(int[] limits)`
`NestedLoopSampling(int[] limits, int nsamples)` Initializes a nested loop sampler with limits.length dimensions.

Method Summary
`boolean` | `hasMoreElements()`
`java.lang.Object` | `nextElement()` Return an integer array sampling the next loop indices for each dimension.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### nsamples

    private int nsamples

### elem

    private int[] elem

### limits

    private int[] limits

### rand

    private java.util.Random rand

Constructor Detail

### NestedLoopSampling

    public NestedLoopSampling(int[] limits,
                              int nsamples)

  Initializes a nested loop sampler with limits.length dimensions.

  Parameters:
    `limits` - limits[i] is the upper limit of the ith nested loop (the loop runs from 0 to limits[i]-1 inclusive)
    `nsamples` - the number of samples to generate before hasMoreElements() returns false

### NestedLoopSampling

    public NestedLoopSampling(int[] limits)

Method Detail

### hasMoreElements

    public boolean hasMoreElements()

  Specified by:
    `hasMoreElements` in interface `java.util.Enumeration`

### nextElement

    public java.lang.Object nextElement()

  Return an integer array sampling the next loop indices for each dimension.

  Specified by:
    `nextElement` in interface `java.util.Enumeration`
  Returns:
    An object of int[] type; the ith value is the loop variable for the ith nested loop.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD