1 27 package ch.ethz.prose.filter; 28 29 30 import java.io.Serializable ; 31 import java.util.List ; 32 import java.util.Vector ; 33 34 import ch.ethz.jvmai.JoinPoint; 35 import ch.ethz.jvmai.CodeJoinPoint; 36 37 import ch.ethz.prose.engine.JoinPointRequest; 38 39 public abstract 62 class PointCutter extends CompositePointFilter implements Serializable { 63 64 public int acceptMask; 65 public int mayFilterStaticallyMask; 66 public int canFilterStaticallyMask; 67 68 70 71 72 82 public boolean isSpecialRequest(JoinPointRequest evRec) 83 { 84 if ( (acceptMask& evRec.getMask()) != 0) 85 { 86 if ((mayFilterStaticallyMask & evRec.getMask()) != 0) 88 { 89 return doIsSpecialRequest(evRec); 90 } 91 else 92 return true; 93 } 94 return 95 false; 96 } 97 98 109 public boolean isSpecialEvent(JoinPoint execEvent) 110 { 111 112 if ((execEvent.getMask() & acceptMask) != 0) 113 { 114 if ( (execEvent.getMask() & canFilterStaticallyMask) == 0) 115 { 116 return doIsSpecialEvent((CodeJoinPoint)execEvent); 118 } 119 else 120 { 121 return true; 123 } 124 } 125 else 126 { 127 return false; 129 } 130 } 131 132 134 protected abstract boolean doIsSpecialEvent(CodeJoinPoint execEvent); 135 136 138 protected abstract boolean doIsSpecialRequest(JoinPointRequest req); 139 140 143 public List memberPointFilters() 144 { 145 Vector result = new Vector (); 146 result.add(this); 147 return result; 148 } 149 150 163 public PointCutter AND(PointCutter other) 164 { 165 return new ANDingPointCutter(this,other); 166 } 167 168 169 182 public PointCutter OR(PointCutter other) 183 { 184 return new ORingPointCutter(this,other); 185 } 186 187 189 String txt; 190 public void setToString(String txt) 191 { 192 this.txt = txt; 193 } 194 195 public String toString() 196 { 197 return txt; 198 } 199 } 200 201 202 | Popular Tags |