1 18 19 package alt.jiapi.instrumentor; 20 21 import java.math.BigDecimal ; 22 23 import org.apache.log4j.Category; 24 25 import alt.jiapi.reflect.InstructionList; 26 import alt.jiapi.Runtime; 27 28 36 public class CombInstrumentor extends AbstractInstrumentor { 37 private static Category log = Runtime.getLogCategory(CombInstrumentor.class); 38 private long pattern; 39 private long mask = 1; 40 41 46 public CombInstrumentor(long pattern) { 47 this.pattern = pattern; 48 } 49 50 public void instrument(InstructionList il) { 51 if ((pattern & mask) == mask) { 52 forward(il); 53 } 54 55 mask = mask << 1; 56 57 if (mask > pattern) { mask = 1; 59 } 60 } 61 } 62 | Popular Tags |