public class DownloadSimulator extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
DownloadSimulator.JobState |
| Constructor and Description |
|---|
DownloadSimulator(ScheduledExecutorService executor,
long bytesPerSecond) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancelDownload() |
void |
close() |
DownloadState |
getState() |
boolean |
startDownload(long jobId,
long totalBytes,
java.util.function.Consumer<DownloadState> consumer,
Runnable whenCompleted) |
protected void |
tick() |
public DownloadSimulator(ScheduledExecutorService executor, long bytesPerSecond)
public boolean startDownload(long jobId,
long totalBytes,
java.util.function.Consumer<DownloadState> consumer,
Runnable whenCompleted)
public boolean cancelDownload()
protected void tick()
public void close()
close in interface AutoCloseablepublic DownloadState getState()
Copyright © 2017. All rights reserved.