我正在尝试通过检查向量是否已经具有数据来向向量添加一些数据,即使向量具有循环即将进入 else 块的数据。
Vector object = (Vector) listUserEvents.get(key);
Vector compareEventData = (Vector) hCompareTable.get(compareKey);
for (int i = 0; i < compareEventData.size(); i++) {
EventData eCompare = (EventData) compareEventData.elementAt(i);
if (object.contains(eCompare)) {
System.out.println("in if of compare");
} else {
System.out.println("in else of compare");
}