public class OrdSetSampler
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
OrdSetSampler.SampleComparator
An internal comparator class used for comparing sample points based on their random SortKey.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Comparator |
AltComparator |
protected java.util.TreeSet |
MainTree |
java.util.Random |
RandomGen |
protected java.util.TreeSet |
SampleTree |
protected int |
Size |
Constructor and Description |
---|
OrdSetSampler()
Create an ordered set sampler where objects order is their "natural order".
|
OrdSetSampler(java.util.Comparator C)
Create an ordered set sampler where objects order is given by the given Comparator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Object X)
Add a new object to the Sampler population.
|
boolean |
addAll(java.util.Collection C)
Adds all of the elements in the specified collection to this set.
|
boolean |
contains(java.lang.Object o)
Returns true if this set contains the specified element.
|
java.lang.Object |
first()
Returns the first (lowest) element currently in this ordered set.
|
java.util.SortedSet |
headSet(java.lang.Object obj)
Get headSet from backing TreeSet.
|
boolean |
isEmpty()
Returns true if this set contains no elements.
|
java.lang.Object |
last()
Returns the last (highest) element currently in this ordered set.
|
java.util.Iterator |
mainIterator()
The OrdElements returned are of class OrdSetElement in natural order of the Object in the Value field
or the order dictated by the user-supplied Comparator.
|
boolean |
remove(java.lang.Object X) |
java.util.Iterator |
sampleIterator()
The OrdElements returned are of class OrdSetElement in order given by their SortKey values.
|
java.lang.Object[] |
sampleWith(int N)
Sample N objects at random with replacement.
|
java.lang.Object[] |
sampleWithout(int N)
Sample N objects at random without replacement.
|
int |
size()
Return number of elements in the ordered set.
|
java.util.SortedSet |
subSet(java.lang.Object obj1,
java.lang.Object obj2)
Get subSet from backing TreeSet.
|
java.util.SortedSet |
tailSet(java.lang.Object obj)
Get tailSet from backing TreeSet.
|
public java.util.Random RandomGen
protected java.util.TreeSet SampleTree
protected java.util.TreeSet MainTree
protected int Size
protected java.util.Comparator AltComparator
public OrdSetSampler()
public OrdSetSampler(java.util.Comparator C)
public boolean add(java.lang.Object X)
public boolean addAll(java.util.Collection C)
public boolean contains(java.lang.Object o)
public boolean remove(java.lang.Object X)
public int size()
public java.lang.Object[] sampleWith(int N)
public java.lang.Object[] sampleWithout(int N)
public java.lang.Object first()
public java.lang.Object last()
public boolean isEmpty()
public java.util.SortedSet subSet(java.lang.Object obj1, java.lang.Object obj2)
public java.util.SortedSet tailSet(java.lang.Object obj)
public java.util.Iterator mainIterator()
public java.util.Iterator sampleIterator()
public java.util.SortedSet headSet(java.lang.Object obj)
Copyright © 2011, 2013. Daniel P. Dougherty