## org.apache.lucene.facet.util
Class RandomSample.Algorithm

    java.lang.Object
      org.apache.lucene.facet.util.RandomSample.Algorithm

Enclosing class:
  RandomSample

    public static class RandomSample.Algorithm

extends Object

For specifying which sampling algorithm to use.

Field Summary
`static RandomSample.Algorithm` `HASHING` Specifies a Fibonacci-style hash algorithm (see Knuth, S&S), which generates a less systematically distributed subset of the sampled collection than the traversal method, but requires a bounded priority queue the size of the sample, and creates an object containing a sampled value and its hash, for every element in the full set.
`static RandomSample.Algorithm` `TRAVERSAL` Specifies a methodical traversal algorithm, which is guaranteed to span the collection at least once, and never to return duplicates.

Method Summary
`String` `toString()` Prints this algorithm's name.

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

Field Detail

### TRAVERSAL

    public static final RandomSample.Algorithm TRAVERSAL

  Specifies a methodical traversal algorithm, which is guaranteed to span the collection at least once, and never to return duplicates. Faster than the hashing algorithm and uses much less space, but the randomness of the sample may be affected by systematic variations in the collection. Requires only an array for the sample, and visits only the number of elements in the sample set, not the full set.

### HASHING

    public static final RandomSample.Algorithm HASHING

  Specifies a Fibonacci-style hash algorithm (see Knuth, S&S), which generates a less systematically distributed subset of the sampled collection than the traversal method, but requires a bounded priority queue the size of the sample, and creates an object containing a sampled value and its hash, for every element in the full set.

Method Detail

### toString

    public String toString()

  Prints this algorithm's name.

  Overrides:
    `toString` in class `Object`

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.