📄 sortalogirthmsensor.aj
字号:
package contextSensor;
import contextsPoolManager.*;
/** This Aspect is automatic generated by ContextModel
* Date: Mon Nov 12 10:51:16 CST 2007
*/
public aspect SortAlogirthmSensor {
pointcut callSorting() : call(* algorithmImp.SortAlgorithmImp.sorting());
after() : callSorting() {
Context context = new Context("callSorting");
CPM.addContext(context);
}
pointcut setSortingData(int[] SortingData) : set(* algorithmImp.SortAlgorithmImp.data) && args(SortingData);
after(int[] SortingData) : setSortingData(SortingData) {
Context context = new Context("setSortingData");
context.addContextData("SortingData", "int[]", SortingData);
CPM.addContext(context);
}
pointcut callSwap(int firstIndex, int secondIndex) : call(* algorithmImp.SortAlgorithmImp.swap(int, int)) && args(firstIndex, secondIndex);
after(int firstIndex, int secondIndex) : callSwap(firstIndex, secondIndex) {
Context context = new Context("callSwap");
context.addContextData("firstIndex", "int", new Integer(firstIndex));
context.addContextData("secondIndex", "int", new Integer(secondIndex));
CPM.addContext(context);
}
pointcut callCompare(int firstIndex, int secondIndex) : call(* algorithmImp.SortAlgorithmImp.compare(int, int)) && args(firstIndex, secondIndex);
after(int firstIndex, int secondIndex) : callCompare(firstIndex, secondIndex) {
Context context = new Context("callCompare");
context.addContextData("firstIndex", "int", new Integer(firstIndex));
context.addContextData("secondIndex", "int", new Integer(secondIndex));
CPM.addContext(context);
}
pointcut callInitialize(int[] aData) : call(* algorithmImp.SortAlgorithmImp.initialize(int[])) && args(aData);
after(int[] aData) : callInitialize(aData) {
Context context = new Context("callInitialize");
context.addContextData("aData", "int[]", aData);
CPM.addContext(context);
}
pointcut callCompareSelected(int index) : call(* algorithmImp.SortAlgorithmImp.compareSelectedWith(int)) && args(index);
after(int index) : callCompareSelected(index) {
Context context = new Context("callCompareSelected");
context.addContextData("index", "int", new Integer(index));
CPM.addContext(context);
}
pointcut callSwapSelected(int index) : call(* algorithmImp.SortAlgorithmImp.swapSelectedWith(int)) && args(index);
after(int index) : callSwapSelected(index) {
Context context = new Context("callSwapSelected");
context.addContextData("index", "int", new Integer(index));
CPM.addContext(context);
}
pointcut callSelect(int index) : call(* algorithmImp.SortAlgorithmImp.select(int)) && args(index);
after(int index) : callSelect(index) {
Context context = new Context("callSelect");
context.addContextData("index", "int", new Integer(index));
CPM.addContext(context);
}
pointcut callPlaceSelected(int targetIndex) : call(* algorithmImp.SortAlgorithmImp.placeSelectedData(int)) && args(targetIndex);
after(int targetIndex) : callPlaceSelected(targetIndex) {
Context context = new Context("callPlaceSelected");
context.addContextData("targetIndex", "int", new Integer(targetIndex));
CPM.addContext(context);
}
pointcut callMoveElement(int fromIndex, int toIndex) : call(* algorithmImp.SortAlgorithmImp.moveElement(int, int)) && args(fromIndex, toIndex);
after(int fromIndex, int toIndex) : callMoveElement(fromIndex, toIndex) {
Context context = new Context("callMoveElement");
context.addContextData("fromIndex", "int", new Integer(fromIndex));
context.addContextData("toIndex", "int", new Integer(toIndex));
CPM.addContext(context);
}
pointcut callQuickSort(int startIndex, int endIndex) : call(* algorithmImp.QuickSortImp.quickSort(int, int)) && args(startIndex, endIndex);
before(int startIndex, int endIndex) : callQuickSort(startIndex, endIndex) {
Context context = new Context("callQuickSort");
context.addContextData("startIndex", "int", new Integer(startIndex));
context.addContextData("endIndex", "int", new Integer(endIndex));
CPM.addContext(context);
}
pointcut callPartition(int startIndex, int endIndex) : call(* algorithmImp.QuickSortImp.partition(int, int)) && args(startIndex, endIndex);
before(int startIndex, int endIndex) : callPartition(startIndex, endIndex) {
Context context = new Context("callPartition");
context.addContextData("startIndex", "int", new Integer(startIndex));
context.addContextData("endIndex", "int", new Integer(endIndex));
CPM.addContext(context);
}
pointcut setMergingData(int[] MergingData) : set(* algorithmImp.MergeSortImp.mergingData) && args(MergingData);
after(int[] MergingData) : setMergingData(MergingData) {
Context context = new Context("setMergingData");
context.addContextData("MergingData", "int[]", MergingData);
CPM.addContext(context);
}
pointcut callMerge(int startIndex, int midIndex, int endIndex) : call(* algorithmImp.MergeSortImp.merge(int, int, int)) && args(startIndex, midIndex, endIndex);
before(int startIndex, int midIndex, int endIndex) : callMerge(startIndex, midIndex, endIndex) {
Context context = new Context("callMerge");
context.addContextData("startIndex", "int", new Integer(startIndex));
context.addContextData("midIndex", "int", new Integer(midIndex));
context.addContextData("endIndex", "int", new Integer(endIndex));
CPM.addContext(context);
}
pointcut callCopyMergedData(int startIndex, int endIndex) : call(* algorithmImp.MergeSortImp.copyMergedData(int, int)) && args(startIndex, endIndex);
after(int startIndex, int endIndex) : callCopyMergedData(startIndex, endIndex) {
Context context = new Context("callCopyMergedData");
context.addContextData("startIndex", "int", new Integer(startIndex));
context.addContextData("endIndex", "int", new Integer(endIndex));
CPM.addContext(context);
}
pointcut callCopyData(int mergingIndex, int dataIndex) : call(* algorithmImp.MergeSortImp.copyData(int, int)) && args(mergingIndex, dataIndex);
after(int mergingIndex, int dataIndex) : callCopyData(mergingIndex, dataIndex) {
Context context = new Context("callCopyData");
context.addContextData("mergingIndex", "int", new Integer(mergingIndex));
context.addContextData("dataIndex", "int", new Integer(dataIndex));
CPM.addContext(context);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -