Queue
public abstract class Queue
源码Source
io/agentscope/runtime/common/collections/Queue.java:24–59队列,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.common.collections 包。核心成员包括 enqueue、dequeue、peek、isEmpty、size。
Abstract base class for queue implementations.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public abstract void enqueue(Map<String, Object> item)abstract | 设置该参数。 Adds an item to the queue. |
public abstract Map<String, Object> dequeue()abstract | 返回 `dequeue` 结果。 Removes and returns an item from the queue. |
public abstract Map<String, Object> peek()abstract | 返回 `peek` 结果。 Returns the front item without removing it. |
public abstract boolean isEmpty()abstract | 判断是否 `isEmpty`。 Checks if the queue is empty. |
public abstract int size()abstract | 返回数量的条目 in 队列。 Returns the number of items in the queue. |
方法详情Method Detail
enqueue
public abstract void enqueue(Map<String, Object> item)
abstract
设置该参数。
Adds an item to the queue.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
item | Map<String, Object> | 条目(类型 `Map`)。Item to enqueue (as a Map) |
源码Source
io/agentscope/runtime/common/collections/Queue.java:30dequeue
public abstract Map<String, Object> dequeue()
abstract
返回 dequeue 结果。
Removes and returns an item from the queue.
Map<String, Object>返回映射。The dequeued item, or null if queue is empty
源码Source
io/agentscope/runtime/common/collections/Queue.java:37peek
public abstract Map<String, Object> peek()
abstract
返回 peek 结果。
Returns the front item without removing it.
Map<String, Object>返回映射。The front item, or null if queue is empty
源码Source
io/agentscope/runtime/common/collections/Queue.java:44isEmpty
public abstract boolean isEmpty()
abstract
判断是否 isEmpty。
Checks if the queue is empty.
boolean返回布尔值,表示判断结果。true if empty, false otherwise
源码Source
io/agentscope/runtime/common/collections/Queue.java:51size
public abstract int size()
abstract
返回数量的条目 in 队列。
Returns the number of items in the queue.
int返回数值结果。Queue size
源码Source
io/agentscope/runtime/common/collections/Queue.java:58