public class NetworkSamplesGenerator
extends java.lang.Object
Constructor and Description |
---|
NetworkSamplesGenerator(SamplingAlgorithm algorithm,
java.util.function.Supplier<StatusBar> statusBarSupplier) |
Modifier and Type | Method and Description |
---|---|
NetworkSamplesGenerator |
downSampleInterval(int downSampleInterval) |
NetworkSamplesGenerator |
dropCount(int dropCount) |
NetworkSamples |
generate(int totalSampleCount) |
int |
getDownSampleInterval() |
int |
getDropCount() |
java.util.stream.Stream<NetworkSample> |
stream() |
public NetworkSamplesGenerator(SamplingAlgorithm algorithm, java.util.function.Supplier<StatusBar> statusBarSupplier)
public int getDropCount()
public NetworkSamplesGenerator dropCount(int dropCount)
dropCount
- the number of samples to drop before collecting anything. If this is zero
then no samples will be dropped before collecting.java.lang.IllegalArgumentException
- when dropCount is less than zeropublic int getDownSampleInterval()
public NetworkSamplesGenerator downSampleInterval(int downSampleInterval)
downSampleInterval
- collect 1 sample for every downSampleInterval. If this is 1 then there will be no
down-sampling. If this is 2 then every other sample will be taken. If this is 3 then
2 samples will be dropped before one is taken.java.lang.IllegalArgumentException
- when downSampleInterval is less than or equal to zeropublic NetworkSamples generate(int totalSampleCount)
totalSampleCount
- The total number of samples to generate. This is the total before any dropping
or down-sampling is done. If you drop 10 and down sample 2 and request a totalSampleCount
of 100 then you would take 100 samples, drop 10 and then take every other sample resulting
in 45 samples returned.public java.util.stream.Stream<NetworkSample> stream()