InMemoryMapping
public class InMemoryMapping extends Mapping
源码Source
io/agentscope/runtime/common/collections/InMemoryMapping.java:27–63In 记忆 Mapping,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.common.collections 包,继承自 Mapping。核心成员包括 set、get、delete、scan、InMemoryMapping。
In-memory implementation of the Mapping interface.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public InMemoryMapping() | 初始化 `InMemoryMapping` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void set(String key, Object value) | 执行设置相关操作。 Performs the set operation. |
public Object get(String key) | 按条件读取数据。 Performs the get operation. |
public void delete(String key) | 删除数据。 Performs the delete operation. |
public List<String> scan(String prefix) | 设置该参数。 Performs the scan operation. |
构造器详情Constructor Detail
InMemoryMapping
public InMemoryMapping()
初始化 InMemoryMapping 实例。
Creates a new instance.
源码Source
io/agentscope/runtime/common/collections/InMemoryMapping.java:30–32方法详情Method Detail
set
public void set(String key, Object value)
执行设置相关操作。
Performs the set operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。The key. |
value | Object | 值(类型 `Object`)。The value. |
源码Source
io/agentscope/runtime/common/collections/InMemoryMapping.java:34–37get
public Object get(String key)
按条件读取数据。
Performs the get operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。The key. |
Object返回对象。Returns object.
源码Source
io/agentscope/runtime/common/collections/InMemoryMapping.java:39–42delete
public void delete(String key)
删除数据。
Performs the delete operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。The key. |
源码Source
io/agentscope/runtime/common/collections/InMemoryMapping.java:44–47scan
public List<String> scan(String prefix)
设置该参数。
Performs the scan operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
prefix | String | prefix(类型 `String`)。The prefix. |
List<String>返回列出。Returns list.
源码Source
io/agentscope/runtime/common/collections/InMemoryMapping.java:49–62