AS AgentScopeAPI 手册 / API Reference

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
itemContainerModel条目(类型 `ContainerModel`)。The container model to enqueue
源码Source io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:30

dequeue

public ContainerModel dequeue()

返回 dequeue 结果。

Remove and return a container from the queue

返回Returns ContainerModel
返回ContainerModel。The container model, or null if queue is empty
源码Source io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:37

peek

public ContainerModel peek()

返回 peek 结果。

Return the first container without removing it

返回Returns ContainerModel
返回ContainerModel。The container model, or null if queue is empty
源码Source io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:44

isEmpty

public boolean isEmpty()

判断是否 isEmpty。

Check if the queue is empty

返回Returns boolean
返回布尔值,表示判断结果。true if empty, false otherwise
源码Source io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:51

size

public int size()

返回大小。

Get the number of containers in the queue

返回Returns int
队列的大小。The size of the queue
源码Source io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:58

clear

public void clear()

清空或重置内部状态。

Clear all containers from the queue

源码Source io/agentscope/runtime/sandbox/manager/collections/ContainerQueue.java:63
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.