Collections.binarySearch

childIDs 数组

cid 要插入的对象

int index = Collections.binarySearch(childIDs, cid);
     if (index < 0) {
      childIDs.insertElementAt(cid, (index + 1) * -1);
      stack.push(cid);
     }

posted @ 2014-06-17 17:04  lightning_95  阅读(217)  评论(0编辑  收藏  举报