-
Notifications
You must be signed in to change notification settings - Fork 12
相依性處理
kanasimi edited this page Nov 3, 2015
·
8 revisions
主檔內建相依性(dependency chain)和關聯性處理 class。
var dc = new CeL.dependency_chain;
dc.add(1, 2);
CeL.assert(['1', CeL.Array_of_Iterator(dc.get(2).previous.values()).join()]);
dc.add(2, 3);
CeL.assert(['2', CeL.Array_of_Iterator(dc.get(3).previous.values()).join()]);
CeL.assert([1, dc.independent(3)]);
CeL.assert(['', CeL.Array_of_Iterator(dc.get(3).next.values()).join()]);
CeL.assert(['1,2,3', CeL.Array_of_Iterator(dc.get()).sort().join()]);
CeL.assert([1, dc.independent()]);
dc.add(0, 1);
CeL.assert([0, dc.independent()]);
dc['delete'](0);
CeL.assert([1, dc.independent()]);