ContainerQueue
public interface ContainerQueue
源码Source
io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:23–64定义容器队列契约的接口。位于 io.agentscope.runtime.sandbox.manager.collections 包。核心成员包括 enqueue、dequeue、peek、isEmpty、size、clear。
Queue interface for container pool management
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void enqueue(ContainerModel item) | 设置该参数。 Add a container to the queue |
public ContainerModel dequeue() | 返回 `dequeue` 结果。 Remove and return a container from the queue |
public ContainerModel peek() | 返回 `peek` 结果。 Return the first container without removing it |
public boolean isEmpty() | 判断是否 `isEmpty`。 Check if the queue is empty |
public int size() | 返回大小。 Get the number of containers in the queue |
public void clear() | 清空或重置内部状态。 Clear all containers from the queue |
方法详情Method Detail
enqueue
public void enqueue(ContainerModel item)
设置该参数。
Add a container to the queue
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
item | ContainerModel | 条目(类型 `ContainerModel`)。The container model to enqueue |
源码Source
io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:30dequeue
public ContainerModel dequeue()
返回 dequeue 结果。
Remove and return a container from the queue
ContainerModel返回ContainerModel。The container model, or null if queue is empty
源码Source
io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:37peek
public ContainerModel peek()
返回 peek 结果。
Return the first container without removing it
ContainerModel返回ContainerModel。The container model, or null if queue is empty
源码Source
io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:44isEmpty
public boolean isEmpty()
判断是否 isEmpty。
Check if the queue is empty
boolean返回布尔值,表示判断结果。true if empty, false otherwise
源码Source
io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:51size
public int size()
返回大小。
Get the number of containers in the queue
int队列的大小。The size of the queue
源码Source
io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:58clear
public void clear()
清空或重置内部状态。
Clear all containers from the queue
源码Source
io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:63