标签归档:List

List.contains方法

if (null != this.engagedNodeIDs && this.engagedNodeIDs.size() > 0) {
for (i = 0; i < this.engagedNodeIDs.size(); i++) { if (this.engagedNodeIDs.get(i).equals(node.getUNID())) { nodeState = "0"; } } } -------------------------------------------------------------------------------- //上面7行等价于以下注释的三行 if(null!=engagedNodeIDs&&engagedNodeIDs.contains(node.getUNID())){ nodeState = "0"; }