1 27 package ch.ethz.prose.filter; 28 29 import java.util.List ; 31 import java.util.Vector ; 32 33 import ch.ethz.jvmai.CodeJoinPoint; 34 import ch.ethz.jvmai.JoinPoint; 35 import ch.ethz.prose.engine.JoinPointRequest; 36 37 38 45 public 46 class ANDingPointCutter extends PointCutter implements ch.ethz.jvmai.JoinPointKinds { 47 48 PointCutter spec1; 49 PointCutter spec2; 50 public ANDingPointCutter(PointCutter spec1, PointCutter spec2) 51 { 52 if (spec1 == null || spec2 == null) 53 throw new IllegalArgumentException ("Null Pointer argument in ANDPointCutter.<init>"); 54 this.spec1=spec1; 55 this.spec2=spec2; 56 acceptMask = spec1.acceptMask & spec2.acceptMask; 57 mayFilterStaticallyMask = spec1.mayFilterStaticallyMask | spec2.mayFilterStaticallyMask; 58 canFilterStaticallyMask = spec1.canFilterStaticallyMask & spec2.canFilterStaticallyMask; 59 } 60 61 62 public List memberPointFilters() 63 { 64 Vector result = new Vector (); 65 result.add(spec1); 66 result.add(spec2); 67 return result; 68 } 69 70 75 protected boolean doIsSpecialRequest(JoinPointRequest r1) 76 { 77 return 87 (spec1.isSpecialRequest(r1)) && (spec2.isSpecialRequest(r1)); 88 89 } 90 91 92 99 protected boolean doIsSpecialEvent(CodeJoinPoint e1) 100 { 101 102 return 103 (spec1.isSpecialEvent(e1)) 104 && 105 (spec2.isSpecialEvent(e1)); 106 107 } 108 109 public String toString() 110 { 111 return "(" + spec1.toString() + ") AND (" + spec2.toString() + ")"; 112 } 113 } 114 115 116 117 118 119 | Popular Tags |