//------------------------------------------------------------------------- // 将队列移到新的队列中 // 相当于原来的list复制到新的list,原来的恢复初始值 public void moveList(EbDoubleLinkList <TObject> pnew_list) { if (!pnew_list.empty()) { pnew_list.init(); pnew_list.mpHead.next = mpHead.next; pnew_list.mpHead.prev = mpHead.prev; init(); } }
//------------------------------------------------------------------------- // 添加队列到本队列(队尾) public void addTailList(EbDoubleLinkList <TObject> plist) { if (!plist.empty()) { EbDoubleLinkNode <TObject> add_list_first = plist.firstNode(); EbDoubleLinkNode <TObject> add_list_last = plist.lastNode(); plist.init(); EbDoubleLinkNode <TObject> list_last = lastNode(); list_last.next = add_list_first; add_list_first.prev = list_last; add_list_last.next = mpHead; mpHead.prev = add_list_last; } }