gpt4 book ai didi

java - eclipse 米洛 : Does method support argument array?

转载 作者:行者123 更新时间:2023-12-01 16:39:38 25 4
gpt4 key购买 nike

OPCUA 服务器有一种带有一个输入参数的方法例如

protected Variant[] invoke(InvocationContext invocationContext, Variant[] inputValues) {
logger.debug("Invoking sqrt() method of objectId={}", invocationContext.getObjectId());

double x = (double) inputValues[0].getValue();
double xSqrt = Math.sqrt(x);

return new Variant[]{new Variant(xSqrt)};
}

在 OPCUA 客户端,我可以使用数组 int 调用此方法吗?例如[1,4,9,16,25]

CallMethodRequest request = new CallMethodRequest(
objectId,
methodId,
new Variant[]{new Variant(input)}
);

这里的inputArguments是Variant数组,我可以设置[1,4,9,16,25]并得到[1,2,3,4,5]吗?

最佳答案

不,事情不是这样的。

不过,您可以在一个 CallRequest 内发送 5 个 CallMethodRequest

关于java - eclipse 米洛 : Does method support argument array?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61887587/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com