| Constructor and Description |
|---|
TestableCpuWorker()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all tasks in this worker.
|
boolean |
offer(CpuTask task)
Adds the specified task to this worker but does not execute it.
|
CpuTask |
peek()
Retrieves, but does not remove, the head of this worker or returns
null if this worker is empty. |
CpuTask |
poll()
Retrieves and removes the head of this worker, or returns
null if
this worker is empty. |
int |
size()
Returns the number of tasks in this worker.
|
ImmutableList<CpuTask> |
toImmutableList()
Returns a new list containing all tasks currently in this worker.
|
public final void clear()
public final boolean offer(CpuTask task)
public final CpuTask peek()
null if this worker is empty.
The head is the task which has been the longest in this worker.
null if this worker is emptypublic final CpuTask poll()
null if
this worker is empty.
The head is the task which has been the longest in this worker.
null if this worker is emptypublic final int size()
public final ImmutableList<CpuTask> toImmutableList()
Copyright © 2021–2022 Objectos Software LTDA. All rights reserved.