removeList=new ArrayList();
removeNodeList=new ArrayList();
createRemoveDiff(o,n,removeNodeList,removeList,updates);
if (removeList.size()>0){
//removeFunctor.execute(removeNodeList,removeList);
events.add(new CacheEvent(source,CacheEvent.NODES_REMOVED,(List)removeNodeList.clone(),(List)removeList.clone()));
}
//}
// long t1=System.currentTimeMillis();
// System.out.println("\t\t\tcache applyUpdates#1 ran in "+(t1-t0)+"ms");
ArrayList insertList=null;
ArrayList insertNodeList=null;
//if (insertFunctor!=null){
insertList=new ArrayList();
insertNodeList=new ArrayList();
createRemoveDiff(n,o,insertNodeList,insertList,updates);
if (insertList.size()>0){
events.add(new CacheEvent(source,CacheEvent.NODES_INSERTED,(List)insertNodeList.clone(),(List)insertList.clone()));
//insertFunctor.execute(insertNodeList,insertList);
}
//}
// t0=System.currentTimeMillis();
// System.out.println("\t\t\tcache applyUpdates#2 ran in "+(t0-t1)+"ms");
//if (removeFunctor!=null&&insertFunctor!=null){
removeList.clear();
removeNodeList.clear();
insertList.clear();
insertNodeList.clear();
createPermutationDiff(o,n,removeNodeList,insertNodeList,removeList,insertList,updates);
if (removeList.size()>0){
events.add(new CacheEvent(source,CacheEvent.NODES_REMOVED,removeNodeList,removeList));
//removeFunctor.execute(removeNodeList,removeList);
}
if (insertList.size()>0){
events.add(new CacheEvent(source,CacheEvent.NODES_INSERTED,(List)insertNodeList.clone(),(List)insertList.clone()));
//insertFunctor.execute(insertNodeList,insertList);
}
// t1=System.currentTimeMillis();
// System.out.println("\t\t\tcache applyUpdates#3 ran in "+(t1-t0)+"ms");
//}
//if (updateFunctor!=null){
insertList.clear();
insertNodeList.clear();
createUpdateDiff(newList,insertNodeList,insertList,updates);
if (insertList.size()>0){
events.add(new CacheEvent(source,CacheEvent.NODES_CHANGED,insertNodeList,insertList));
//updateFunctor.execute(insertNodeList,insertList);
}
//}
// t0=System.currentTimeMillis();
// System.out.println("\t\t\tcache applyUpdates#4 ran in "+(t0-t1)+"ms");