这是我的定义
message point{
optional float x = 1;
optional float y = 2;
}
message test{
repeated field point = 1;
}
Run Code Online (Sandbox Code Playgroud)
在我的example.java文件中,我试图创建一个构建器,如下所示:
for(i = 0; i < somearr.size(); i++)
{
// I get x and y values from traversing the array
float x = getX;
float y = getY;
// now I want to set the repeated field point
}
Run Code Online (Sandbox Code Playgroud)
如何设置重复场点?
我正在尝试删除 HashMap 中除指定的键集之外的所有条目。例如,HashMap numToalphaMap 具有条目 1-->a、2-->b、3-->c、4-->d。给定的 KeySet 是 {1, 2}。我想从 numToalphaMap 中删除其他条目,即.., (3-->c, 4-->d)。有人能帮我解决这个问题吗?