私はこの形式のツリー構造を持っています:
Index1
|
--Key1
--Value1
Index2
|
--Key2
--Value2
Key
Value
オブジェクトはオブジェクトの子でありIndex
、ツリーにはインデックス オブジェクトがありません。
Index
オブジェクト ( indexList
)、Key
オブジェクト ( keyList
)、およびValue
オブジェクト ( )の配列リストを管理していますvalueList
。
viewer
のオブジェクトですTreeViewer
。
私の目的は Index オブジェクトを削除することであり、このアクションを担当するコードは次のとおりです。
String indexName = text.getText();
for(int i =0; i< model.indexList.size(); i++)
{
if(model.indexList.get(i).getName().equals(indexName))
{
Index temp = model.indexList.get(i);
int noOfKeys = temp.keyList.size();
int noOfValues = temp.valueList.size();
for(int j=0; j<noOfKeys ; j++ )
{
temp.keyList.remove(j);
temp.valueList.remove(j);
}
model.indexList.remove(i);
break;
}
}
viewer.refresh();
削除アクションを実行すると、ノードは削除されますが、スタック オーバーフロー エラーが発生します。
どこで間違ったのか教えてください。